env_rails 0.1 → 0.2
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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/env_rails/version.rb +1 -1
- data/lib/env_rails.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c767f4ca811162f1fcb922a8426fd8a7ae7f9e40
|
4
|
+
data.tar.gz: 73325bd74eb1bffc9e7cc6f3f07fde8e5ee1a02a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94ec82648f17e6012ca447600f089cdee9dbae4e6cf2d00e09f3b31b0c13c09e1f59b1bae45c11f759683cfe9564e4bd9299e8dcd80ff2b656c8cc9635de5125
|
7
|
+
data.tar.gz: 1383a0e90a6850f068ae874a7849c539d1be9d0bf2447ce65947a776d2d021f31580908cdb9f0cfb3578886820be7aa9510c0fa09a870274f46aaea7cd498816
|
data/README.md
CHANGED
@@ -18,12 +18,12 @@ And then execute:
|
|
18
18
|
|
19
19
|
This gem is a Railtie plugin. It doesn't require any special configuration.
|
20
20
|
|
21
|
-
When the Rails application starts it will pick up any environment variable matching a name like
|
21
|
+
When the Rails application starts it will pick up any environment variable matching a name like **RAILS_CONFIG__foo__bar** and apply the value to the corresponding Rails configuration.
|
22
22
|
|
23
23
|
For example:
|
24
24
|
|
25
25
|
```
|
26
|
-
|
26
|
+
RAILS_CONFIG__action_mailer__smtp_settings__address=smtpserver.yourdomain.com
|
27
27
|
```
|
28
28
|
|
29
29
|
## Contributing
|
data/lib/env_rails/version.rb
CHANGED
data/lib/env_rails.rb
CHANGED
@@ -4,8 +4,8 @@ module EnvRails
|
|
4
4
|
class Railtie < Rails::Railtie
|
5
5
|
config.after_initialize do
|
6
6
|
ENV.each do |key, value|
|
7
|
-
if key =~ /\ARAILS_CONFIG((
|
8
|
-
config_path = $1.split('
|
7
|
+
if key =~ /\ARAILS_CONFIG((__[a-z_]+)+)\Z/
|
8
|
+
config_path = $1.split('__')[1 .. -1]
|
9
9
|
parameter_name = config_path.pop
|
10
10
|
|
11
11
|
# Find or create the parameter container
|