lib/arii/sqlseedreader.rb in arii-1.2.1 vs lib/arii/sqlseedreader.rb in arii-1.2.2
- old
+ new
@@ -12,21 +12,21 @@
#
# => Load the seed data into the @objects array for processing.
#
def read
begin
- @client = Mysql2::Client.new(:host => @seed[:payload][:host], :username => @seed[:payload][:username] , :password => @seed[:payload][:password] , :database => @seed[:payload][:database])
- @client.query(@seed[:payload][:query], :cast => false).each(:symbolize_keys => false) do |row|
+ @client = Mysql2::Client.new(:host => @seed[:payload][:host], :username => @seed[:payload][:username], :password => @seed[:payload][:password], :database => @seed[:payload][:database])
+ @client.query(@seed[:payload][:query], :cast => false).each(:symbolize_keys => false) do |row|
begin
- object = @help.deep_copy @agent[:payload]
- object.each_pair do |key,value|
+ object = @help.deep_copy @agent[:payload]
+ object.each_pair do |key, value|
variables = @help.identify_variables(object[key])
variables.each do |v|
object[key].gsub!("%{#{v}}", row[@seed[:payload][:selectors][v]].to_str)
end
end
-
+
unless @seed[:payload][:cache].nil? then
object[:seed] = row[@seed[:payload][:cache]]
else
object[:seed] = row["id"]
end
@@ -35,12 +35,12 @@
rescue Exception => e
end
end
rescue Exception => e
-
+
end
-
+
@objects
end
end
end
\ No newline at end of file