env_hash_config 1.0.0 → 1.1.0
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/lib/env_hash_config.rb +2 -1
- data/lib/env_hash_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: b1ddf0b921c0c3dcb2d1077e42a6ce3483726b6f
|
4
|
+
data.tar.gz: ca6f34e82f066157343d55b84f5bb41b44dbb502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee8b47bb1717f37f28bff945d7a7e5dda0098ef491be4436e6a442b2ee2c421f8b24790313c725e37c670e50cadac806c2c04e16079ffb49ecd9e0ae92aa4c32
|
7
|
+
data.tar.gz: 34bdde9c475f006991cd6c743203188433a6499915fa43a132bfd0f2f7090f51ed9a6df4b79c471ed58e5b0e1a3b54563bda7e6e40cc11d2dea867bb72fa04a9
|
data/lib/env_hash_config.rb
CHANGED
@@ -2,9 +2,10 @@ require 'env_hash_config/version'
|
|
2
2
|
require 'ostruct'
|
3
3
|
|
4
4
|
module EnvHashConfig
|
5
|
-
def self.create(options: ENV, array_options: [], default_options: {}, integer_options: [])
|
5
|
+
def self.create(options: ENV, array_options: [], boolean_options: [], default_options: {}, integer_options: [])
|
6
6
|
options = options.inject({}) { |h,(k,v)| h.tap { |h| h[k.downcase.to_sym] = v } }
|
7
7
|
options = array_options.inject(options) { |h,k| h.tap { |h| h[k] = h[k].split ',' if h[k] } }
|
8
|
+
options = boolean_options.inject(options) { |h,k| h.tap { |h| h[k] = h[k] == 'true' if h[k] } }
|
8
9
|
options = integer_options.inject(options) { |h,k| h.tap { |h| h[k] = h[k].to_i if h[k] } }
|
9
10
|
options = default_options.merge options
|
10
11
|
options = yield options if block_given?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: env_hash_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Willkomm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|