lib/forklift/base/connection.rb in forklift_etl-1.1.12 vs lib/forklift/base/connection.rb in forklift_etl-1.2.0
- old
+ new
@@ -36,35 +36,35 @@
def pipe
# when copying within the same connection, this method can be defined to speed things up
raise 'not implemented'
end
- def exec(path)
+ def exec(path, *args)
begin
- exec!(path)
+ exec!(path, &args)
rescue Exception => e
forklift.logger.log(e)
end
end
- def exec!(path)
+ def exec!(path, *args)
forklift.logger.log "Running script: #{path}"
extension = path.split(".").last
if(extension == "rb" || extension == "ruby")
- exec_ruby(path)
+ exec_ruby(path, *args)
else
- exec_script(path)
+ exec_script(path, *args)
end
end
- def exec_ruby(path)
+ def exec_ruby(path, *args)
klass = forklift.utils.class_name_from_file(path)
require path
model = eval("#{klass}.new")
- model.do!(self, forklift)
+ model.do!(self, forklift, *args)
end
- def exec_script(path)
+ def exec_script(path, *args)
raise 'not implemented'
end
end
end