configer 0.0.1.pre.pre → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/configer.rb +14 -11
- data/sample/load_meta_files.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 967b15a461f7897e7dc1614c1dce0ddf61909692
|
4
|
+
data.tar.gz: 9d3effb1c8c94a461bcf3f61cdb7ea7d611f8917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 827822ae7a15db9b3076a967ce001065fe02bca837de77c8aecab7e8cda5a5ceea69522830a5cfa00451547736f64c8c325fa748b111c59cb2fe10ec4f5b99a5
|
7
|
+
data.tar.gz: cc1d733812ed880af4f82fef03bca882c8b1bd77c60003e5c16433f339091989b5b5ea5a44388c86c2b553f28c43671a65b0f5f521c0992989fa37fc6dee92d5
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
1.0.0
|
data/lib/configer.rb
CHANGED
@@ -30,20 +30,22 @@ module Configer
|
|
30
30
|
path_elements= var.split(File::Separator)
|
31
31
|
path_elements.delete('')
|
32
32
|
|
33
|
-
tmp_hsh=
|
33
|
+
tmp_hsh= {}
|
34
34
|
current_obj= nil
|
35
35
|
|
36
|
-
path_elements.
|
36
|
+
path_elements.count.times { |index|
|
37
37
|
|
38
|
+
key_str= path_elements[index]
|
38
39
|
(current_obj ||= tmp_hsh)
|
39
|
-
current_obj[key_str]= ConfigObject.new
|
40
|
-
current_obj= current_obj[key_str]
|
40
|
+
current_obj[key_str]= {} #ConfigObject.new
|
41
|
+
current_obj= current_obj[key_str] unless index == (path_elements.count-1)
|
41
42
|
|
42
43
|
}
|
43
44
|
|
44
|
-
current_obj= YAML.safe_load File.read file_path
|
45
|
+
current_obj[ path_elements.last ]= YAML.safe_load File.read file_path
|
45
46
|
Data.config_hash.deep_merge!(tmp_hsh)
|
46
47
|
|
48
|
+
return nil
|
47
49
|
end
|
48
50
|
|
49
51
|
end
|
@@ -71,21 +73,22 @@ module Configer
|
|
71
73
|
path_elements= var.split(File::Separator)
|
72
74
|
path_elements.delete('')
|
73
75
|
|
74
|
-
tmp_hsh=
|
76
|
+
tmp_hsh= {}
|
75
77
|
current_obj= nil
|
76
78
|
|
77
|
-
path_elements.
|
79
|
+
path_elements.count.times { |index|
|
78
80
|
|
81
|
+
key_str= path_elements[index]
|
79
82
|
(current_obj ||= tmp_hsh)
|
80
|
-
current_obj[key_str]= ConfigObject.new
|
81
|
-
current_obj= current_obj[key_str]
|
83
|
+
current_obj[key_str]= {} #ConfigObject.new
|
84
|
+
current_obj= current_obj[key_str] unless index == (path_elements.count-1)
|
82
85
|
|
83
86
|
}
|
84
87
|
|
85
|
-
current_obj= JSON.parse File.read file_path
|
86
|
-
puts tmp_hsh
|
88
|
+
current_obj[ path_elements.last ]= JSON.parse File.read file_path
|
87
89
|
Data.config_hash.deep_merge!(tmp_hsh)
|
88
90
|
|
91
|
+
return nil
|
89
92
|
end
|
90
93
|
|
91
94
|
end
|
data/sample/load_meta_files.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
@@ -99,9 +99,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- - "
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
104
|
+
version: '0'
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project:
|
107
107
|
rubygems_version: 2.2.2
|