dotenv-rails 2.5.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +38 -6
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 74ce487fc36b6cb776eae1c46dcf21a2d11828dc10b0e9eded8ad4a494345a8e
|
4
|
+
data.tar.gz: bfa6b2138b5f304b28a2ce330f9c7c8eab2acdf9ce9a333476618da5eb7b01cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efb6be5f362f136329eb53dfbc4458022207ae21e2a71723c46aaa21d420c1ab4c0494b5343f4c4f350562c328b76d8f4a868c5714732095053bd386ff630b72
|
7
|
+
data.tar.gz: 3890168011975a01f7300a3b890db4e2e6d044a5b354dfd7660d29cf95fd8955e6a0a74bb3daad23642d653aadd5c2932b7d2d200b5b40c58acc370f9212ad9a
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# dotenv [![Build Status](https://secure.travis-ci.org/bkeepers/dotenv.
|
1
|
+
# dotenv [![Build Status](https://secure.travis-ci.org/bkeepers/dotenv.svg?branch=master)](https://travis-ci.org/bkeepers/dotenv) [![Gem Version](https://badge.fury.io/rb/dotenv.svg)](https://badge.fury.io/rb/dotenv) [![Join the chat at https://gitter.im/bkeepers/dotenv](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/bkeepers/dotenv?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
2
2
|
|
3
3
|
Shim to load environment variables from `.env` into `ENV` in *development*.
|
4
4
|
|
@@ -163,6 +163,31 @@ SECRET_KEY=YOURSECRETKEYGOESHERE # comment
|
|
163
163
|
SECRET_HASH="something-with-a-#-hash"
|
164
164
|
```
|
165
165
|
|
166
|
+
### Required Keys
|
167
|
+
|
168
|
+
If a particular configuration value is required but not set, it's appropriate to raise an error.
|
169
|
+
|
170
|
+
To require configuration keys:
|
171
|
+
|
172
|
+
```ruby
|
173
|
+
# config/initializers/dotenv.rb
|
174
|
+
|
175
|
+
Dotenv.require_keys("SERVICE_APP_ID", "SERVICE_KEY", "SERVICE_SECRET")
|
176
|
+
```
|
177
|
+
|
178
|
+
If any of the configuration keys above are not set, your application will raise an error during initialization. This method is preferred because it prevents runtime errors in a production application due to improper configuration.
|
179
|
+
|
180
|
+
### Parsing
|
181
|
+
|
182
|
+
To parse a list of env files for programmatic inspection without modifying the ENV:
|
183
|
+
|
184
|
+
```ruby
|
185
|
+
Dotenv.parse(".env.local", ".env")
|
186
|
+
# => {'S3_BUCKET' => 'YOURS3BUCKET', 'SECRET_KEY' => 'YOURSECRETKEYGOESHERE', ...}
|
187
|
+
```
|
188
|
+
|
189
|
+
This method returns a hash of the ENV var name/value pairs.
|
190
|
+
|
166
191
|
## Frequently Answered Questions
|
167
192
|
|
168
193
|
### Can I use dotenv in production?
|
@@ -175,12 +200,19 @@ If you use this gem to handle env vars for multiple Rails environments (developm
|
|
175
200
|
|
176
201
|
### What other .env* files can I use?
|
177
202
|
|
178
|
-
`dotenv-rails` will
|
203
|
+
`dotenv-rails` will override in the following order (highest defined variable overrides lower):
|
204
|
+
|
205
|
+
| Hierarchy Priority | Filename | Environment | Should I `.gitignore`it? | Notes |
|
206
|
+
| ------------------ | ------------------------ | -------------------- | --------------------------------------------------- | ------------------------------------------------------------ |
|
207
|
+
| 1st (highest) | `.env.development.local` | Development | Yes! | Local overrides of environment-specific settings. |
|
208
|
+
| 1st | `.env.test.local` | Test | Yes! | Local overrides of environment-specific settings. |
|
209
|
+
| 1st | `.env.production.local` | Production | Yes! | Local overrides of environment-specific settings. |
|
210
|
+
| 2nd | `.env.local` | Wherever the file is | Definitely. | Local overrides. This file is loaded for all environments _except_ `test`. |
|
211
|
+
| 3rd | `.env.development` | Development | No. | Shared environment-specific settings |
|
212
|
+
| 3rd | `.env.test` | Test | No. | Shared environment-specific settings |
|
213
|
+
| 3rd | `.env.production` | Production | No. | Shared environment-specific settings |
|
214
|
+
| Last | `.env` | All Environments | Depends (See [below](#should-i-commit-my-env-file)) | The Original® |
|
179
215
|
|
180
|
-
- `.env` - The Original®
|
181
|
-
- `.env.development`, `.env.test`, `.env.production` - Environment-specific settings.
|
182
|
-
- `.env.local` - Local overrides. This file is loaded for all environments _except_ `test`.
|
183
|
-
- `.env.development.local`, `.env.test.local`, `.env.production.local` - Local overrides of environment-specific settings.
|
184
216
|
|
185
217
|
### Should I commit my .env file?
|
186
218
|
|
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: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-22 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: 2.
|
19
|
+
version: 2.7.0
|
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: 2.
|
26
|
+
version: 2.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: railties
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '3.2'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '6.
|
36
|
+
version: '6.1'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '3.2'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '6.
|
46
|
+
version: '6.1'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: spring
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
|
-
|
93
|
-
rubygems_version: 2.6.13
|
92
|
+
rubygems_version: 3.0.1
|
94
93
|
signing_key:
|
95
94
|
specification_version: 4
|
96
95
|
summary: Autoload dotenv in Rails.
|