module Construi::Config::EnvironmentVariables

Public Instance Methods

env() click to toggle source
# File lib/construi/config.rb, line 89
def env
  env_hash.each_with_object([]) do |(k, v), a|
    a << "#{k}=#{v}" unless v.nil? || v.empty?
  end
end
env_configured?() click to toggle source
# File lib/construi/config.rb, line 71
def env_configured?
  key? :environment
end
env_hash() click to toggle source
# File lib/construi/config.rb, line 75
def env_hash
  parent = with_parent({}, &:env_hash)

  child = get(:environment, {}).each_with_object({}) do |v, h|
    key, value = v.split '='

    value = ENV[key] if value.nil? || value.empty?

    h[key] = value
  end

  parent.merge child
end