lib/mutaconf.rb in mutaconf-0.0.6 vs lib/mutaconf.rb in mutaconf-0.0.7
- old
+ new
@@ -1,16 +1,16 @@
# encoding: UTF-8
module Mutaconf
- VERSION = '0.0.6'
+ VERSION = '0.0.7'
def self.dsl *args
DSL.new *args
end
def self.env *args
options = args.last.kind_of?(Hash) ? args.pop : {}
- args.inject({}) do |memo,key|
+ args.flatten.inject({}) do |memo,key|
env_key = options[:upcase] == false ? key.to_s : key.to_s.upcase
prefix = options[:prefix]
prefix = prefix.upcase if prefix and options[:upcase] != false
memo[key.to_sym] = ENV["#{prefix}#{env_key}"]
memo