dotenv-rails 2.7.6 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -4
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d0c13519d33404b622266fbf7ff71079a199716ac564e4a2729384b15b970d7
|
4
|
+
data.tar.gz: f2da97acce1fb1e953e000114f9f01edb596adb0676b20a1e11cc8d77e6c405b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d2102375cd88ce4b90c44629d0976062f9d9ebe05f95e480f38f6dcd509c28d23d8dff295339e2f4870263e595fcff6f45d6f972fee2e00a67a8b946979032a
|
7
|
+
data.tar.gz: 420d8614065db0398d72e13548c53ee25aa1da6d1676a96a7a0f93dbe33aca24e5ea4c48073b37ee29645a0bbcc56e6082289bd9473e37ade4f395eec2176099
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# dotenv [![
|
1
|
+
# 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
|
|
@@ -30,7 +30,10 @@ dotenv is initialized in your Rails app during the `before_configuration` callba
|
|
30
30
|
# config/application.rb
|
31
31
|
Bundler.require(*Rails.groups)
|
32
32
|
|
33
|
-
|
33
|
+
# Load dotenv only in development or test environment
|
34
|
+
if ['development', 'test'].include? ENV['RAILS_ENV']
|
35
|
+
Dotenv::Railtie.load
|
36
|
+
end
|
34
37
|
|
35
38
|
HOSTNAME = ENV['HOSTNAME']
|
36
39
|
```
|
@@ -223,7 +226,7 @@ You can use the `-t` or `--template` flag on the dotenv cli to create a template
|
|
223
226
|
```shell
|
224
227
|
$ dotenv -t .env
|
225
228
|
```
|
226
|
-
A template will be created in your working directory named `{FINAME}.template`. So in the above example, it would create a `.env.template` file.
|
229
|
+
A template will be created in your working directory named `{FINAME}.template`. So in the above example, it would create a `.env.template` file.
|
227
230
|
|
228
231
|
The template will contain all the environment variables in your `.env` file but with their values set to the variable names.
|
229
232
|
|
@@ -233,7 +236,7 @@ S3_BUCKET=YOURS3BUCKET
|
|
233
236
|
SECRET_KEY=YOURSECRETKEYGOESHERE
|
234
237
|
```
|
235
238
|
|
236
|
-
Would become
|
239
|
+
Would become
|
237
240
|
|
238
241
|
```shell
|
239
242
|
# .env.template
|
@@ -247,6 +250,11 @@ Personally, I prefer to commit the `.env` file with development-only settings. T
|
|
247
250
|
|
248
251
|
By default, it **won't** overwrite existing environment variables as dotenv assumes the deployment environment has more knowledge about configuration than the application does. To overwrite existing environment variables you can use `Dotenv.overload`.
|
249
252
|
|
253
|
+
You can also use the `-o` or `--overload` flag on the dotenv cli to override existing `ENV` variables.
|
254
|
+
```shell
|
255
|
+
$ dotenv -o -f ".env.local,.env"
|
256
|
+
```
|
257
|
+
|
250
258
|
## Contributing
|
251
259
|
|
252
260
|
If you want a better idea of how dotenv works, check out the [Ruby Rogues Code Reading of dotenv](https://www.youtube.com/watch?v=lKmY_0uY86s).
|
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.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-27 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.8.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: 2.
|
26
|
+
version: 2.8.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: railties
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,7 +68,7 @@ homepage: https://github.com/bkeepers/dotenv
|
|
68
68
|
licenses:
|
69
69
|
- MIT
|
70
70
|
metadata: {}
|
71
|
-
post_install_message:
|
71
|
+
post_install_message:
|
72
72
|
rdoc_options: []
|
73
73
|
require_paths:
|
74
74
|
- lib
|
@@ -83,8 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
87
|
-
signing_key:
|
86
|
+
rubygems_version: 3.2.32
|
87
|
+
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Autoload dotenv in Rails.
|
90
90
|
test_files: []
|