config 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -3
- data/README.md +3 -1
- data/lib/config/options.rb +8 -1
- data/lib/config/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bfea09c1ef9b78b0942e487411324dc3af0772c
|
4
|
+
data.tar.gz: ac44c082dd7fb235f7bd5345d15d8f581cecb528
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 034d7088dc7729f0f849fd956620fe4fc25da2995b26f886c5e7bf7c14261aa329a7b74d94881162c93b316a8f840db694ae032cf16897746d1091a52b978b05
|
7
|
+
data.tar.gz: 259b136866b0ed5f49add1bdd81f26e05b1caac25e9673eeaefdb18d907813649dfe688bfeb3238d9de3c5ac0bfd453cccd398ca363b50d8cd0ab32df5c158cf
|
data/CHANGELOG.md
CHANGED
@@ -2,8 +2,15 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
### New features
|
6
|
+
|
5
7
|
...
|
6
8
|
|
9
|
+
## 1.5.1
|
10
|
+
|
11
|
+
### New features
|
12
|
+
* Add parsing of ENV variable values to Boolean type
|
13
|
+
|
7
14
|
## 1.5.0
|
8
15
|
|
9
16
|
### New features
|
@@ -86,6 +93,3 @@
|
|
86
93
|
|
87
94
|
* Expose Settings in application.rb, so you don't have to duplicate configuration for each environment file ([#59](https://github.com/railsjedi/config/issues/59))
|
88
95
|
* Adding support for Rails 4.1.0.rc ([#70](https://github.com/railsjedi/config/issues/70))
|
89
|
-
|
90
|
-
|
91
|
-
|
data/README.md
CHANGED
@@ -344,13 +344,14 @@ You can customize how environment variables are processed:
|
|
344
344
|
* `env_converter` (default: `:downcase`) - how to process variables names:
|
345
345
|
* `nil` - no change
|
346
346
|
* `:downcase` - convert to lower case
|
347
|
-
* `env_parse_values` (default: `true`) - try to parse values to a correct type (`Integer`, `Float`, `String`)
|
347
|
+
* `env_parse_values` (default: `true`) - try to parse values to a correct type (`Boolean`, `Integer`, `Float`, `String`)
|
348
348
|
|
349
349
|
For instance, given the following environment:
|
350
350
|
|
351
351
|
```bash
|
352
352
|
SETTINGS__SECTION__SERVER_SIZE=1
|
353
353
|
SETTINGS__SECTION__SERVER=google.com
|
354
|
+
SETTINGS__SECTION__SSL_ENABLED=false
|
354
355
|
```
|
355
356
|
|
356
357
|
And the following configuration:
|
@@ -370,6 +371,7 @@ The following settings will be available:
|
|
370
371
|
```ruby
|
371
372
|
Settings.section.server_size # => 1
|
372
373
|
Settings.section.server # => 'google.com'
|
374
|
+
Settings.section.ssl_enabled # => false
|
373
375
|
```
|
374
376
|
|
375
377
|
## Contributing
|
data/lib/config/options.rb
CHANGED
@@ -188,7 +188,14 @@ module Config
|
|
188
188
|
|
189
189
|
# Try to convert string to a correct type
|
190
190
|
def __value(v)
|
191
|
-
|
191
|
+
case v
|
192
|
+
when 'false'
|
193
|
+
false
|
194
|
+
when 'true'
|
195
|
+
true
|
196
|
+
else
|
197
|
+
Integer(v) rescue Float(v) rescue v
|
198
|
+
end
|
192
199
|
end
|
193
200
|
end
|
194
201
|
end
|
data/lib/config/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Kuczynski
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-10-
|
13
|
+
date: 2017-10-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|