lib/populate_env/heroku/manifest.rb in populate-env-0.1.0 vs lib/populate_env/heroku/manifest.rb in populate-env-0.1.1
- old
+ new
@@ -9,10 +9,14 @@
def attribute_definitions_for(environment)
begin
data = JSON.parse(@path.read, symbolize_names: true)
env_vars = data.fetch(:env, {})
- env_vars.merge!(data.dig(:environments, environment.to_sym, :env) || {})
+ env_vars.merge!(
+ data.fetch(:environments, {})
+ .fetch(environment.to_sym, {})
+ .fetch(:env, {})
+ )
env_vars.map do |key, value|
if value.is_a?(Hash)
default = value.delete(:value)
value.merge!(name: key, default: default)