configer 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/configer/support.rb +7 -1
- data/lib/configer/yaml.rb +5 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 289ebe062db31097bcb5eb65c166a5f263f21e59
|
4
|
+
data.tar.gz: 1b3d4cb6ea1f7ae77af56eb29b4e5f76c54f9d0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d92002648fcf9678f2eb6379cd6e5ea1c59fd69e58ab01377452ba1753aad7cb7a6719215985a10e8a92ca432d62490b6fd5c8fed078da9cce8423ecff59ee3c
|
7
|
+
data.tar.gz: 6190430662b11cb980ce1cb7dee0dc6e3848e710d07116d8c8f1aa8c5b70f2343c721804cf500f91b317c950e68e31fcfe3f04cd027442e8abf96894baa5942e
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.1
|
data/lib/configer/support.rb
CHANGED
@@ -89,7 +89,13 @@ module Configer
|
|
89
89
|
|
90
90
|
object = if %W[ yaml yml ].include?(extension)
|
91
91
|
require 'yaml'
|
92
|
-
|
92
|
+
|
93
|
+
if YAML.respond_to?(:save_load)
|
94
|
+
YAML.safe_load(File.read(path))
|
95
|
+
else
|
96
|
+
YAML.load(File.read(path))
|
97
|
+
end
|
98
|
+
|
93
99
|
elsif extension == 'json'
|
94
100
|
require 'json'
|
95
101
|
JSON.parse(File.read(path))
|
data/lib/configer/yaml.rb
CHANGED
@@ -37,7 +37,11 @@ module Configer
|
|
37
37
|
|
38
38
|
}
|
39
39
|
|
40
|
-
|
40
|
+
method_to_call = YAML.respond_to?(:safe_load) ? :safe_load : :load
|
41
|
+
current_obj[ path_elements.last ]= YAML.public_send(
|
42
|
+
method_to_call,
|
43
|
+
File.read(file_path)
|
44
|
+
)
|
41
45
|
|
42
46
|
opts[:out].deep_merge!(tmp_hsh)
|
43
47
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -93,3 +93,4 @@ signing_key:
|
|
93
93
|
specification_version: 4
|
94
94
|
summary: super easy to use config module for general use
|
95
95
|
test_files: []
|
96
|
+
has_rdoc:
|