lib/arii/jsonseedreader.rb in arii-1.2.1 vs lib/arii/jsonseedreader.rb in arii-1.2.2
- old
+ new
@@ -14,25 +14,25 @@
#
def read
begin
url = RestClient.get @seed[:payload][:uri]
@doc = url.to_str
- JsonPath.on(@doc,@seed[:payload][:query]).each do |element|
+ JsonPath.on(@doc, @seed[:payload][:query]).each do |element|
begin
object = @help.deep_copy @agent[:payload]
- object.each_pair do |key,value|
+ object.each_pair do |key, value|
variables = @help.identify_variables(object[key])
variables.each do |v|
JsonPath.on(element, @seed[:payload][:selectors][v]).each do |el|
object[key].gsub!("%{#{v}}", el.to_s)
end
end
end
- JsonPath.on(element,@seed[:payload][:cache]).each do |el|
+ JsonPath.on(element, @seed[:payload][:cache]).each do |el|
object[:seed] = el
end
object[:identifier] = @agent.identifier
\ No newline at end of file