lib/arii/detector.rb in arii-1.2.1 vs lib/arii/detector.rb in arii-1.2.2

- old
+ new

@@ -19,13 +19,13 @@ begin @agent = agent @payloads = Array.new @objects = Array.new @help = ARII::Helper.new - ARII::Config.log.info(self.class.name) {"Started new #{agent.identifier} detector"} + ARII::Config.log.info(self.class.name) { "Started new #{agent.identifier} detector" } rescue Exception => e - ARII::Config.log.error(self.class.name) {"#{e}"} + ARII::Config.log.error(self.class.name) { "#{e}" } end end ## @@ -40,42 +40,42 @@ # => Process seed data, if available. # unless @agent.seeds.nil? then @agent.seeds.each do |seed| case seed[:publisher] - when 'csv' - begin - @sr = ARII::CSVSeedReader.new(@agent, seed) - rescue Exception => e - ARII::Config.log.error(self.class.name) {"#{e}"} - end - when 'sql' - begin - @sr = ARII::SQLSeedReader.new(@agent, seed) - rescue Exception => e - ARII::Config.log.error(self.class.name) {"#{e}"} - end - when 'xml' - begin - @sr = ARII::XMLSeedReader.new(@agent, seed) - rescue Exception => e - ARII::Config.log.error(self.class.name) {"#{e}"} - end - when 'json' - begin - @sr = ARII::JSONSeedReader.new(@agent, seed) - rescue Exception => e - ARII::Config.log.error(self.class.name) {"#{e}"} - end + when 'csv' + begin + @sr = ARII::CSVSeedReader.new(@agent, seed) + rescue Exception => e + ARII::Config.log.error(self.class.name) { "#{e}" } + end + when 'sql' + begin + @sr = ARII::SQLSeedReader.new(@agent, seed) + rescue Exception => e + ARII::Config.log.error(self.class.name) { "#{e}" } + end + when 'xml' + begin + @sr = ARII::XMLSeedReader.new(@agent, seed) + rescue Exception => e + ARII::Config.log.error(self.class.name) { "#{e}" } + end + when 'json' + begin + @sr = ARII::JSONSeedReader.new(@agent, seed) + rescue Exception => e + ARII::Config.log.error(self.class.name) { "#{e}" } + end end begin @reads = @sr.read @reads.each do |read| @objects.push read end rescue Exception => e - ARII::Config.log.error(self.class.name) {"#{e}"} + ARII::Config.log.error(self.class.name) { "#{e}" } end end else ## @@ -90,21 +90,21 @@ end @objects.push object end rescue Exception => e @response = {:status => 404, :message => "[ARII][Detector] failed to load doc, #{e}"} - ARII::Config.log.error(self.class.name) {"#{e}"} + ARII::Config.log.error(self.class.name) { "#{e}" } end begin # increase detected events count @templates = Array.new - @response = { :payload => @payloads, :templates => @templates, :status => 100} + @response = {:payload => @payloads, :templates => @templates, :status => 100} rescue Exception => e @response = {:status => 404, :message => "[ARII][Detector] failed to process queries, #{e}"} - ARII::Config.log.error(self.class.name) {"#{e}"} + ARII::Config.log.error(self.class.name) { "#{e}" } end @response end \ No newline at end of file