Skip to content

Commit

Permalink
Add Config::Options#split
Browse files Browse the repository at this point in the history
  • Loading branch information
rdodson41 committed Aug 1, 2017
1 parent 1f7bc91 commit fc7f9b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/config/options.rb
Expand Up @@ -37,9 +37,9 @@ def reload_env!
hash = Hash.new

ENV.each do |variable, value|
keys = variable.to_s.split(Config.env_separator)
keys = split(variable)

prefix = (Config.env_prefix || Config.const_name).to_s.split(Config.env_separator)
prefix = split(Config.env_prefix || Config.const_name)

next if keys.shift(prefix.size) != prefix

Expand Down Expand Up @@ -154,6 +154,10 @@ def []=(param, value)

protected

def split(string)
string.to_s.split(Config.env_separator)
end

def descend_array(array)
array.map do |value|
if value.instance_of? Config::Options
Expand Down

0 comments on commit fc7f9b2

Please sign in to comment.