enfig 0.2.1 → 0.3.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 +7 -0
- data/lib/enfig.rb +3 -2
- metadata +6 -8
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 14079eb1a46fb5ca18d881f303b09a5ac8783bad
|
|
4
|
+
data.tar.gz: c674b61f6a4df07071113e092279539b4b7f8837
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 8a848e6d06cb22b09f927584b0a046f304b25cfbc32a19d0c8150a4a01311ff9d1532ff871da845b99e47c28cc89eafff1d367087959c62bcbef0344cc30d4c2
|
|
7
|
+
data.tar.gz: 05886acd24473dd0882b7df074afd2fb010a824b68b06f674daf81ae7d6767ac9f6aa4739f46c19e062d9a85f61c0a99342bd53b25b1133a63197d794f302710
|
data/lib/enfig.rb
CHANGED
|
@@ -8,7 +8,7 @@ class Enfig
|
|
|
8
8
|
|
|
9
9
|
def initialize(args = {})
|
|
10
10
|
@config = nil
|
|
11
|
-
@env = args[:env]
|
|
11
|
+
@env = args[:env]
|
|
12
12
|
@root = args[:root] || ''
|
|
13
13
|
@files = args[:files] || [args[:file]].compact
|
|
14
14
|
@enable_overwrite = args[:overwrite] == false ? false : true
|
|
@@ -49,7 +49,8 @@ class Enfig
|
|
|
49
49
|
|
|
50
50
|
def load_yaml(*args)
|
|
51
51
|
config = YAML.load_file(File.join(root, *args))
|
|
52
|
-
|
|
52
|
+
data = env.nil? ? config : config[env]
|
|
53
|
+
symbolize_keys(data)
|
|
53
54
|
end
|
|
54
55
|
|
|
55
56
|
def load_env_hash(config_src, target = {}, prefix = nil)
|
metadata
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: enfig
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 0.3.0
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Arturo Guzman
|
|
@@ -21,26 +20,25 @@ files:
|
|
|
21
20
|
homepage: http://github.com/guzart/enfig
|
|
22
21
|
licenses:
|
|
23
22
|
- MIT
|
|
23
|
+
metadata: {}
|
|
24
24
|
post_install_message:
|
|
25
25
|
rdoc_options: []
|
|
26
26
|
require_paths:
|
|
27
27
|
- lib
|
|
28
28
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
29
|
-
none: false
|
|
30
29
|
requirements:
|
|
31
|
-
- -
|
|
30
|
+
- - '>='
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
32
|
version: '0'
|
|
34
33
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
-
none: false
|
|
36
34
|
requirements:
|
|
37
|
-
- -
|
|
35
|
+
- - '>='
|
|
38
36
|
- !ruby/object:Gem::Version
|
|
39
37
|
version: '0'
|
|
40
38
|
requirements: []
|
|
41
39
|
rubyforge_project:
|
|
42
|
-
rubygems_version: 1.
|
|
40
|
+
rubygems_version: 2.1.9
|
|
43
41
|
signing_key:
|
|
44
|
-
specification_version:
|
|
42
|
+
specification_version: 4
|
|
45
43
|
summary: ENV values for your project
|
|
46
44
|
test_files: []
|