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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1fda95b040388bca8a27b746c8b35e769e2339f
4
- data.tar.gz: a518b9327105e9648555c0abff94d9852424749a
3
+ metadata.gz: 967b15a461f7897e7dc1614c1dce0ddf61909692
4
+ data.tar.gz: 9d3effb1c8c94a461bcf3f61cdb7ea7d611f8917
5
5
  SHA512:
6
- metadata.gz: a57c16d7848a10d3ef8e7562c733ef53f81a9e5131714baae001133a656f46b3df1e7a493a08ccf1e8525ba160fed7759c081260b77bbaf28ea1ad9427268703
7
- data.tar.gz: 6adad0d2afb269dea6c0970f4f368ce147050348db1ec2abe41c6a132034ec2246c27052d21e9398b1a83b0ed003160d9fac132a8ba355bbd126a5a6a1670484
6
+ metadata.gz: 827822ae7a15db9b3076a967ce001065fe02bca837de77c8aecab7e8cda5a5ceea69522830a5cfa00451547736f64c8c325fa748b111c59cb2fe10ec4f5b99a5
7
+ data.tar.gz: cc1d733812ed880af4f82fef03bca882c8b1bd77c60003e5c16433f339091989b5b5ea5a44388c86c2b553f28c43671a65b0f5f521c0992989fa37fc6dee92d5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- configer (0.0.1.pre.pre)
4
+ configer (1.0.0)
5
5
  hashie
6
6
  loader
7
7
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1.pre.pre
1
+ 1.0.0
@@ -30,20 +30,22 @@ module Configer
30
30
  path_elements= var.split(File::Separator)
31
31
  path_elements.delete('')
32
32
 
33
- tmp_hsh= ConfigObject.new
33
+ tmp_hsh= {}
34
34
  current_obj= nil
35
35
 
36
- path_elements.each { |key_str|
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= ConfigObject.new
76
+ tmp_hsh= {}
75
77
  current_obj= nil
76
78
 
77
- path_elements.each { |key_str|
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
@@ -6,4 +6,4 @@ Configer.mount_json
6
6
  configer #> config
7
7
 
8
8
  # for example we can call the root/sample/meta/test.yml file parsed data as
9
- # puts configer.sample.meta.test #> { hello: world }
9
+ puts configer.sample.meta.test #> { hello: world }
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.1.pre.pre
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: 1.3.1
104
+ version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
107
  rubygems_version: 2.2.2