See #476 for more details and to discuss this release.
Breaking Changes
Ruby >= 3.0 and Rails >= 6.1 are now required. Lock dotenv to ~> 2.0 if you are using an outdated Ruby or Rails version. #466, #471
\n is no longer expanded into a newline in quoted strings. Use multi-line strings with real line breaks, or set DOTENV_LINEBREAK_MODE=legacy to preserve the old behavior. @nitsujri#423
Fixed precedence when using Dotenv::Rails.overload. So now .env.development.local will overwrite .env.local, which will overwrite .env.development, which will overwrite .env. @eriklovmo - #460
The instrumentation event dotenv.load has been renamed to load.dotenv to properly make use of namespaces in ActiveSupport::Notifications#472
Other improvements
All changes to ENV will be logged in Rails apps. #473
Fixed an issue where rake loaded development files (.env*development) for test-related tasks. #470
Add -i/--ignore option to dotenv CLI to optionally ignore missing files. @stevenharman#463
The dotenv-rails gem is now superfluous. It's not technically deprecated yet and will continue to work, but the dotenv gem does the same thing. #468
Dotenv::Railtie has been deprecated. Use Dotenv::Rails. #468
Dotenv.overload has been replaced with overwrite. overload will still work and is not technically deprecated, but documentation refers to Dotenv.overwrite now. #469
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.
All Depfu comment commands
@depfu rebase
Rebases against your default branch and redoes this update
@depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@depfu cancel merge
Cancels automatic merging of this PR
@depfu close
Closes this PR and deletes the branch
@depfu reopen
Restores the branch and reopens this PR (if it's closed)
@depfu pause
Ignores all future updates for this dependency and closes this PR
@depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)
Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.
What changed?
✳️ dotenv (~> 2 → ~> 3) · Repo · Changelog
Release Notes
3.0.0
Does any of this look wrong? Please let us know.
Commits
See the full diff on Github. The new version differs by 70 commits:
Prepare for 3.0.0 release
Restore the table showing files loaded and order
Clarify autorestore behavior
Skip bumping version for now, tag has already been created
Bump version to match tag name as part of release
Debug refs to see if I can set version in release
Only run on release published
Use official Ruby gem for publishing
Release 3.0.0.beta
Draft of changelog for 3.0
Remove gitter badge, add link to API docs
Use main branch
API doc updates
Avoid memozing Diff since final state can change
Merge pull request #475 from bkeepers/threadsafe
Handle thread safety for Dotenv.restore, Add Dotenv.modify for thread safety
Merge pull request #473 from bkeepers/log-everything
Merge remote-tracking branch 'origin/master' into log-everything
Merge pull request #472 from bkeepers/save-and-restore
Use setup+teardown in AS::TestCase
Update README
Configure files for `rake test`
Rename test_help to autorestore
Log all changes to ENV
Fix tests for Rails 6.1
Fix specs for Rails 7.0
Try to load deprecator in 7.1
Fix lint error
Add ability to save/restore ENV, automatically load in Rails
Merge pull request #471 from bkeepers/rails-improvements
Call super() in subclasses
Set required_ruby_version in gemspec
Bump required Rails version to 7.1
Add Rails 6.1, 7.0, and 7.1 to build matrix
Only register deprecator if supported (Rails < 7.1)
Merge pull request #470 from bkeepers/rake-test-rails-env
Log what was loaded when Rails.logger is initialized
Load test wen running `rake test`
Merge pull request #469 from bkeepers/overwrite
Merge pull request #468 from bkeepers/refactor-rails
Merge pull request #467 from bkeepers/refactor
Consistently use "overwrite" in place of "overload" and "override"
Remove instance after test
Update and reorganize README
Use `Dotenv::Rails.overwrite = true` instead of overload
Include Rails integration in `dotenv` gem
Refactor Rails integration
Rename Dotenv::Railtie => Dotenv::Rails
Avoid modifying Rails.env
Refactor Railtie to allow customizing files
Update docs, remove unused method
Update standard config to latest supported Ruby version
Refactor internal API to reduce duplication
Add DOTENV_LINEBREAK_MODE=legacy to preserve newline expansion
Merge remote-tracking branch 'origin/master' into jenfi-eng/master
Merge pull request #460 from eriklovmo/respect-file-priority-policy-when-overloading
Merge remote-tracking branch 'origin/master' into respect-file-priority-policy-when-overloading
Merge pull request #463 from stevenharman/optionally_ignore_missing_files_from_cli
Tweak logic for deciding which method to load
Merge pull request #464 from bkeepers/dependabot/github_actions/actions/checkout-4
Merge remote-tracking branch 'origin/master' into optionally_ignore_missing_files_from_cli
Bump actions/checkout from 3 to 4
Merge pull request #466 from bkeepers/ruby-3.3
Remove EOL Ruby versions from build matrix (2.5, 2.6, 2.7)
Fix lint errors
Add Ruby 3.3 to the build matrix
Appease Standard.rb
Optionally ignore missing files from CLI
Use console syntax highlights for console commands
fix: always respect file importance order
Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with
@depfu rebase
.All Depfu comment commands