lib/rubber/environment.rb in nirvdrum-rubber-1.1.7 vs lib/rubber/environment.rb in nirvdrum-rubber-2.0.0.rails3.beta6
- old
+ new
@@ -20,11 +20,11 @@
@config_secret = bind().rubber_secret
read_config(@config_secret) if @config_secret
end
def read_config(file)
- LOGGER.debug{"Reading rubber configuration from #{file}"}
+ Rubber.logger.debug{"Reading rubber configuration from #{file}"}
if File.exist?(file)
@items = Environment.combine(@items, YAML.load_file(file) || {})
end
end
@@ -143,17 +143,17 @@
# Forces role/host overrides into config
def bind_config(global)
global = global.clone()
role_overrides = global.delete("roles") || {}
host_overrides = global.delete("hosts") || {}
- roles.to_a.each do |role|
- role_overrides[role].each do |k, v|
+ Array(roles).each do |role|
+ Array(role_overrides[role]).each do |k, v|
global[k] = Environment.combine(global[k], v)
- end if role_overrides[role]
+ end
end
- host_overrides[host].each do |k, v|
+ Array(host_overrides[host]).each do |k, v|
global[k] = Environment.combine(global[k], v)
- end if host_overrides[host]
+ end
return global
end
def method_missing(method_id)
key = method_id.id2name
\ No newline at end of file