lib/rake/funnel/tasks/environments_support/loader.rb in rake-funnel-0.0.1.pre vs lib/rake/funnel/tasks/environments_support/loader.rb in rake-funnel-0.0.2.pre

- old
+ new

@@ -15,18 +15,24 @@ config.fetch(:config_files, []).each do |file| log("#{operation} #{file}") operation = 'Merging' yaml = File.read(file) - yaml = ERB.new(yaml).result + yaml = evaluate_erb(yaml, file) yaml = YAML.load(yaml) || {} store.configure_from_hash(yaml) end store.lock! log('') log(store.inspect) + end + + def evaluate_erb(yaml, filename) + render = ERB.new(yaml) + render.filename = filename + render.result end private def log(message) Rake.rake_output_message(message)