-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix load to respect existing environment variables over env file when doing variable interpolation #323
Conversation
… doing variable interpolation
a83e34f
to
7f82f73
Compare
👋 @cbjoseph ! Apologies that this has been sitting for so long, I'm part of a trio of new maintainers of this project, and we're trying to clear out the backlog of folks waiting for responses. There appears to be a merge conflict associated with some of our work clearing up said backlog. Could you please resolve the conflict so I can review? Thank you! |
@cadwallion resolved conflicts! Thanks for taking a look. |
@cbjoseph it looks like there is one rubocop error:
I believe fixing that up should be the last step. |
@jonmagic oops! fixed rubocop error, should be all good now |
Looks good, thanks for the contribution! |
I think that something is still off with the implementation.
#!/usr/bin/env ruby
# frozen_string_literal: true
def display_envs()
puts
puts "TEST=#{ENV['TEST']}"
puts "TEST_COMBINED=#{ENV['TEST_COMBINED']}"
puts
end
puts "Before loading .env..."
display_envs
require 'dotenv'
puts Dotenv::Environment.new('.env', true).inspect
ENV.update(Dotenv::Environment.new('.env', true))
puts "After loading .env..."
display_envs |
/cc @cbjoseph @cadwallion |
@cadwallion Can you comment on expectation of this Environment class? My assumption was that it's an internal tool, since it seems undocumented. Could you provide more context on its use case? |
This change just caught us off guard as well with a gem update. @cbjoseph: Is it documented anywhere that Ideally, any changes to a public method signature should be backwards compatible. What does everyone think about making the i.e. def initialize(filename, is_load = true)
@filename = filename
load(is_load)
end |
* Commit 7f82f73 introduced a backwards-incompatible change with the current API with respect to `Dotenv::Environment#intialize` by changing the method signature. * Make the new parameter default to false to retain backwards compatibility. * Similar changes were made for `Dotenv::Parser` in bkeepers#338. SEE: bkeepers#323 SEE: bkeepers#338
Breaking change was introduced in minor version with bkeepers/dotenv#323
I also wanted to jump in that this broke many setups for fastlane and fastlane.ci, as it was introduced with a minor version bump. Adding a default parameter with #345 sounds like a great fix 👍 |
Curious to know if Dotenv::Environment should be considered public given
that it's not documented.
|
Closes issue #319.