lib/arii/xmldetector.rb in arii-1.2.1 vs lib/arii/xmldetector.rb in arii-1.2.2
- old
+ new
@@ -11,11 +11,11 @@
public
##
# == Detect the changes
#
def detect object
- ARII::Config.log.info(self.class.name) {"Monitoring #{object[:uri]}"} unless object[:uri].nil?
+ ARII::Config.log.info(self.class.name) { "Monitoring #{object[:uri]}" } unless object[:uri].nil?
begin
if object[:uri] == '' then
@doc = Nokogiri::XML(object[:content])
else
@doc = Nokogiri::XML(open(object[:uri]))
@@ -36,16 +36,16 @@
##
# If not on cache, add to payload for processing
#
if @cache[:cache][:status] == 100 then
- ARII::Config.log.info(self.class.name) {"Not on cache, generating payload"}
+ ARII::Config.log.info(self.class.name) { "Not on cache, generating payload" }
# add row data to payload from selectors (key => key, value => column name)
payload = Hash.new
object[:selectors].each do |selector|
- selector.each do |k,v|
+ selector.each do |k, v|
element.xpath(v).each do |el|
payload[k] = el.content
end
end
end
@@ -54,9 +54,9 @@
end
end
end
rescue Exception => e
- ARII::Config.log.error(self.class.name) {"Processing error: #{e}"}
+ ARII::Config.log.error(self.class.name) { "Processing error: #{e}" }
end
end
end
\ No newline at end of file