simple-config 0.1.13 → 0.1.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 786fea737e4806f56063629c07c4d26dab04257a
4
- data.tar.gz: 9bede00456cb6cdaa5db393efcd7ca07d9e12af0
3
+ metadata.gz: 0492daf736ff882d31e285804ece0592efdac1ad
4
+ data.tar.gz: af6faec1a9e0f20432092982a0eec071fa16c222
5
5
  SHA512:
6
- metadata.gz: 6fa8a79b0b045b929e5c9137df2a4e6a52965cea0224e9ee32d1e3f944d9f84bc9127dbc9eb267e6b5695802e28e8841621c139fe76d9d7c6a0eef43b4779d8b
7
- data.tar.gz: a6fcc2bc442a561cb2bb37eafc2647368140e856153603c92530fc0428baaf5d2adedffb9cac6730cf8e94ca8556cda75554753f15e08c119b4ace7c14ad1844
6
+ metadata.gz: d371bf7bec4871a215947400b928d2f6e2f41cf675e9f651c4071b4808c9e0700c16297e456f5b46c25b9509fb0b8eeaba28080a776dcbf448b657d8c71e8837
7
+ data.tar.gz: 44f587e8207ed22d28c49951761bc585940c76c6fca6405f52263ccd6d5459ad19eeb62c86c9856704fd840530f27fb718094644f944e5a8166b0ab68c527422
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/simple-config.rb CHANGED
@@ -12,12 +12,12 @@ class SimpleConfig
12
12
 
13
13
  def initialize(x=nil)
14
14
 
15
- m = {:String => :scan_to_h, :Hash => :scan_to_s}
15
+ m = {:String => :parse_to_h, :Hash => :scan_to_s}
16
16
  method(m[x.class.to_s.to_sym]).call(x) if x
17
17
  end
18
18
 
19
19
  def parse(t=nil)
20
- scan_to_h(t || @to_s)
20
+ parse_to_h(t || @to_s)
21
21
  end
22
22
 
23
23
  def write(h=nil)
@@ -26,6 +26,10 @@ class SimpleConfig
26
26
 
27
27
  private
28
28
 
29
+ def parse_to_h(s)
30
+ txt, _ = RXFHelper.read(s)
31
+ scan_to_h(txt)
32
+ end
29
33
 
30
34
  def pretty_print(a, indent='')
31
35
 
@@ -34,9 +38,8 @@ class SimpleConfig
34
38
  end
35
39
 
36
40
 
37
- def scan_to_h(raw_txt)
41
+ def scan_to_h(txt)
38
42
 
39
- txt, _ = RXFHelper.read(raw_txt)
40
43
  raw_a = LineTree.new(txt.gsub(/(^-*$)|(#.*)/,'').strip).to_a
41
44
 
42
45
  @to_h = raw_a.inject({}) do |r, line|
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.13
4
+ version: 0.1.14
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-11-06 00:00:00.000000000 Z
34
+ date: 2014-11-22 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: line-tree
metadata.gz.sig CHANGED
Binary file