From 72a1483c8f546fae6c93dcdf91cfd47c37bc2f90 Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 9 Feb 2015 18:54:32 -0700 Subject: use agent registration to endpoint for registering fake agent. --- lib/tasks/agent.rake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/tasks/agent.rake') diff --git a/lib/tasks/agent.rake b/lib/tasks/agent.rake index 1857454..482cd77 100644 --- a/lib/tasks/agent.rake +++ b/lib/tasks/agent.rake @@ -1,24 +1,24 @@ namespace :agent do require 'fake_agent' - ENDPOINT='http://localhost:3000' desc "watch all files" task watch: :environment do - agent = FakeAgent.new(Agent.first.id, ENDPOINT) + agent = FakeAgent.new + agent.register agent.watch(Dir.pwd) end desc "scan directory" task scan: :environment do - agent = FakeAgent.new(Agent.first.id, ENDPOINT) + agent = FakeAgent.new + agent.register agent.scan(Dir.pwd) end desc "scan network traffic" task :nfm do - id = Agent.first.id - agent = FakeAgent.new(id, ENDPOINT) - + agent = FakeAgent.new + agent.register agent.packet_capture('eth0') end end -- cgit v1.2.3