config 1.5.0 → 1.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b6ae90fa7f141cfc8e3f6eff8f1434a108f2b99
4
- data.tar.gz: b41fb4da0c7de1352f9f192c8fcebc7a6e53382a
3
+ metadata.gz: 0bfea09c1ef9b78b0942e487411324dc3af0772c
4
+ data.tar.gz: ac44c082dd7fb235f7bd5345d15d8f581cecb528
5
5
  SHA512:
6
- metadata.gz: e65ffa447a2e2fb94fd0941dbbc8ad4034bec9bdf1a5509224f69f3c927dedb10d7d36f9ca41fe1f452e4e5adc9def529eade2b6a6248570ae9ac92c3fa7afdd
7
- data.tar.gz: eabc5a9851556abd9d30b07496b4f3e3fb00108a6d29e3868dcc32004f62368a9d32348beeb211d1425a44d931689cf389116b81cf4f259a6a52aa67a28012d8
6
+ metadata.gz: 034d7088dc7729f0f849fd956620fe4fc25da2995b26f886c5e7bf7c14261aa329a7b74d94881162c93b316a8f840db694ae032cf16897746d1091a52b978b05
7
+ data.tar.gz: 259b136866b0ed5f49add1bdd81f26e05b1caac25e9673eeaefdb18d907813649dfe688bfeb3238d9de3c5ac0bfd453cccd398ca363b50d8cd0ab32df5c158cf
@@ -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
@@ -188,7 +188,14 @@ module Config
188
188
 
189
189
  # Try to convert string to a correct type
190
190
  def __value(v)
191
- Integer(v) rescue Float(v) rescue v
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
@@ -1,3 +1,3 @@
1
1
  module Config
2
- VERSION = '1.5.0'
2
+ VERSION = '1.5.1'
3
3
  end
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.0
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-06 00:00:00.000000000 Z
13
+ date: 2017-10-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport