simple-config 0.1.16 → 0.2.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: 3802eadf526f76b397016241703e797aba91053c
4
- data.tar.gz: ec5f8ae2dac660f98f63a85fa3a40530c87bbe92
3
+ metadata.gz: 5a78543561276bf2a41b0ad0f97b3b8ed32b6266
4
+ data.tar.gz: dd4b63f6b51fe383ff2ef343398fd1b5c0e7760c
5
5
  SHA512:
6
- metadata.gz: 0d1b5026c0cd3f59003531f2ef2836b1bea4f05117c5f4f567d3a478068e24944b65f6fc6e5498568bd6698fc33545ba48ed36dc84c5bd0466805773dcc54e2f
7
- data.tar.gz: e34abe993b229824625535cc911c63a57101e1230716a70f456b8210e3144ee088b20ee64f983b629b8f55a664eb09608f4df343501cdc1e75071d43d827d505
6
+ metadata.gz: bd003abc4c71a4224ba05ca577439f18978d7811355b74a9fe51bed4713e20d8eab68ad0914ff397596b74e7a37f6d0f41199b3cfd561d8a668df68f17571adc
7
+ data.tar.gz: 8be658647026bfc25ccdec334dd4a043869f22a9e90698ff2c629b7cd9932130469bc92326741d25db4c54245b64dfe2fc93358a2a236be67c1efcfc321c23b6
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/simple-config.rb CHANGED
@@ -12,7 +12,7 @@ class SimpleConfig
12
12
 
13
13
  def initialize(x=nil)
14
14
 
15
- m = {:String => :parse_to_h, :Hash => :scan_to_s}
15
+ m = {:String => :parse_to_h, :Hash => :write}
16
16
  method(m[x.class.to_s.to_sym]).call(x) if x
17
17
  end
18
18
 
@@ -21,7 +21,8 @@ class SimpleConfig
21
21
  end
22
22
 
23
23
  def write(h=nil)
24
- scan_to_s h || @to_h
24
+ @to_h = h || @to_h
25
+ scan_to_s @to_h
25
26
  end
26
27
 
27
28
  private
@@ -100,8 +101,8 @@ class SimpleConfig
100
101
 
101
102
  end
102
103
 
103
- def scan_to_s(h, indent='')
104
-
104
+ def scan_to_s(h, indent='')
105
+
105
106
  a = h.inject([]) do |r, x|
106
107
  if x.last.is_a? Hash then
107
108
  r << x.first.to_s + ":\n" + scan_to_s(x.last, ' ')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  GOyi72Dr1XTvfW8Vje543EzUeJP4EjrtsoS0tbx5hs2J8Ey8zv39aU4aNyM1h0Fv
32
32
  1BzvTQ2PY7IAEQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-12-28 00:00:00.000000000 Z
34
+ date: 2014-12-29 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: line-tree
@@ -39,20 +39,20 @@ dependencies:
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.3'
42
+ version: '0.4'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.3.17
45
+ version: 0.4.5
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: '0.3'
52
+ version: '0.4'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.3.17
55
+ version: 0.4.5
56
56
  description:
57
57
  email: james@r0bertson.co.uk
58
58
  executables: []
metadata.gz.sig CHANGED
Binary file