dotenv-rails 3.0.0.beta → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +54 -6
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84017f2c53d971b597af22f799cab58020ad0b76336fe82469dcd702e36173d9
4
- data.tar.gz: c7511d8dce62e068cd518c857f913df66bccbd13dde70b9ff73279f4637eb1d3
3
+ metadata.gz: 8f2b607facc1a9f8b32394eb625956f2f23e448b7bc812f5047218d702355792
4
+ data.tar.gz: 33452c26ed90e436cf4c4df6fdb8f91f3d0ba671cd5a3187e05c63996aaf7532
5
5
  SHA512:
6
- metadata.gz: ac03c442d9b507484044c2674e2705df3d9ce852a1cc22b1c8d34ce6042cdd8bd0221163847767bc5f3de9b97db59cfceb67e2b09c7c123d090ea921603aa707
7
- data.tar.gz: cee6b5d3693c43e9a54ad6ab06e493174ffc68f6ef7bc892b067f0b46066a369bb563af675b028fb59cd4908e4d9c192c43ac9eafdd962c80525db344398c4b5
6
+ metadata.gz: f212654ed9af1e5a0f634a6e98736e2d0880e7a3f084d3d15e00df47c7cf4cfd863d0ec5b53b248c3f4daf65eb422ff714091335013dcd7b50ffadd0f2110b51
7
+ data.tar.gz: 1ab95d0679eb1e99a1f8144b4e883659095ce63b368dbead49e51e24781eba66b72e05a856f6138c0c205abc1afaffe9574cdf02e12f8bccd367edb68730e8b6
data/README.md CHANGED
@@ -56,9 +56,9 @@ Dotenv.load('file1.env', 'file2.env')
56
56
 
57
57
  ## Autorestore in tests
58
58
 
59
- Since 3.0, dotenv in a Rails app will automatically restore `ENV` to its original state before each test. This means you can modify `ENV` in your tests without fear of leaking state to other tests. It works with both `ActiveSupport::TestCase` and `Rspec`.
59
+ Since 3.0, dotenv in a Rails app will automatically restore `ENV` after each test. This means you can modify `ENV` in your tests without fear of leaking state to other tests. It works with both `ActiveSupport::TestCase` and `Rspec`.
60
60
 
61
- To disable this behavior, set `config.dotenv.autorestore = false` in `config/application.rb` or `config/environments/test.rb`.
61
+ To disable this behavior, set `config.dotenv.autorestore = false` in `config/application.rb` or `config/environments/test.rb`. It is disabled by default if your app uses [climate_control](https://github.com/thoughtbot/climate_control) or [ice_age](https://github.com/dpep/ice_age_rb).
62
62
 
63
63
  To use this behavior outside of a Rails app, just `require "dotenv/autorestore"` in your test suite.
64
64
 
@@ -107,11 +107,59 @@ gem 'gem-that-requires-env-variables'
107
107
 
108
108
  ### Customizing Rails
109
109
 
110
- Dotenv will load the following files depending on `RAILS_ENV`, with the last file listed having the highest precedence:
110
+ Dotenv will load the following files depending on `RAILS_ENV`, with the first file having the highest precedence, and `.env` having the lowest precedence:
111
+
112
+ <table>
113
+ <thead>
114
+ <tr>
115
+ <th>Priority</th>
116
+ <th colspan="3">Environment</th>
117
+ <th><code>.gitignore</code>it?</th>
118
+ <th>Notes</th>
119
+ </tr>
120
+ <tr>
121
+ <th></th>
122
+ <th>development</th>
123
+ <th>test</th>
124
+ <th>production</th>
125
+ <th></th>
126
+ <th></th>
127
+ </tr>
128
+ </thead>
129
+ <tr>
130
+ <td>highest</td>
131
+ <td><code>.env.development.local</code></td>
132
+ <td><code>.env.test.local</code></td>
133
+ <td><code>.env.production.local</code></td>
134
+ <td>Yes</td>
135
+ <td>Environment-specific local overrides</td>
136
+ </tr>
137
+ <tr>
138
+ <td>2nd</td>
139
+ <td><code>.env.local</code></td>
140
+ <td><strong>N/A</strong></td>
141
+ <td><code>.env.local</code></td>
142
+ <td>Yes</td>
143
+ <td>Local overrides</td>
144
+ </tr>
145
+ <tr>
146
+ <td>3rd</td>
147
+ <td><code>.env.development</code></td>
148
+ <td><code>.env.test</code></td>
149
+ <td><code>.env.production</code></td>
150
+ <td>No</td>
151
+ <td>Shared environment-specific variables</td>
152
+ </tr>
153
+ <tr>
154
+ <td>last</td>
155
+ <td><code>.env</code></td>
156
+ <td><code>.env</code></td>
157
+ <td><code>.env</code></td>
158
+ <td><a href="#should-i-commit-my-env-file">Maybe</a></td>
159
+ <td>Shared for all environments</td>
160
+ </tr>
161
+ </table>
111
162
 
112
- * **development**: `.env`, `.env.development`, `.env.local`, `.env.development.local`
113
- * **test**: `.env`, `.env.test`, `.env.test.local` - Note that it will **not** load `.env.local`.
114
- * **development**: `.env`, `.env.production`, `.env.local`, `.env.production.local`
115
163
 
116
164
  These files are loaded during the `before_configuration` callback, which is fired when the `Application` constant is defined in `config/application.rb` with `class Application < Rails::Application`. If you need it to be initialized sooner, or need to customize the loading process, you can do so at the top of `application.rb`
117
165
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotenv-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-25 00:00:00.000000000 Z
11
+ date: 2024-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.0.beta
19
+ version: 3.0.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.0.beta
26
+ version: 3.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: railties
29
29
  requirement: !ruby/object:Gem::Requirement