lib/apidragon/api.rb in apidragon-1.6.1 vs lib/apidragon/api.rb in apidragon-1.6.2
- old
+ new
@@ -14,11 +14,11 @@
# All variables are dumped into a variable bucket (@arg_bucket)
# so that they can be used as parameters for function calls.
def initialize(macro_name, config, username, password)
@config_file = config
- `mkdir #{PLUGINS}` unless Dir.exist? PLUGINS
+ Dir.mkdir PLUGINS unless Dir.exist? PLUGINS
@arg_bucket = {}
set 'username', username unless username.nil?
set 'password', password unless password.nil?
@config = load_config @config_file
import @config['vars']
@@ -33,12 +33,12 @@
def go
@macro.each_pair do |_key, value|
call = Call.new(value, @arg_bucket)
@arg_bucket = call.run
- if !value['record'].nil?
+ unless value['record'].nil?
value['record'].each do |var|
- add_config_var var, get(var) unless var=='function'
+ if value['record'].include?(var) then add_config_var var, get(var) end
end
end
end
end