simple-config 0.3.0 → 0.3.1

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: 48983176722cf5588e3bb1a264ad3e6ebebc35e1
4
- data.tar.gz: 88d92071f6b902be0d5590f60ba03bd7588c316a
3
+ metadata.gz: 5dbbe370cc11a379846501d44fc7d43a8b6cb37a
4
+ data.tar.gz: 8c682713f0ce9f035ec58443624729e361061677
5
5
  SHA512:
6
- metadata.gz: b7e808d0242911bfadd1835d163c939a9d2f04bb465b458bf3865aaa4557f46f7c1142eed39c56da3994b1c71c5e82f53686285fcf19b5a1c36eea89af4e2dd9
7
- data.tar.gz: 1f60b741b0c3faddc4ca9571ea229151639cc1c536481f2ea7c36c48a0bd886c56cfa754a9f0afda095b8f159fed847676da16786d022cc2843c735a92807b66
6
+ metadata.gz: 45b7b0a3e3db7ff3c8c75685c55d56bf1fe0eb2e01a0bb6c70277924824341bfc219bb1d8bc46f37778eb1ac5bc81ffde5ecc1d7f559ea2b84cc1388c825f46d
7
+ data.tar.gz: 31921d2e57a1010f643a30b783cacd8b3e66ce084a9428d8702ee23393ebc85cf04fdb0ea2834ee4408b7f2f44bb66ad6b20869026e0a5e55db750193a0e99bf
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- .�Q��F N0l��nsu3 �2��%��,~�Ĕ�
2
- �ߩ��xK妆���8�Ѥ�cqN�@�8�����L���
3
- +�Ԗ/�P'$E7㜈ȞGV9,��h+t��\���\Mm���:@�g����n^
1
+ _���K{��=��yg�ڕ�7 ����@xO��������@n+o�4F��S 2�?ܯ >g=:k+
2
+ 9YO.>�y^��6$[��{�@3��CX�Ѿ^��_o]��q�B�RLk�U���"��An
3
+ �p^b���\������k �G�r��<�3���j���-5V�%�0t�dB��f��e Y���F��*���Rz��8�d��w�d6Hث�3iז�� B��b0��W�Z���2��o
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 => :write}
15
+ m = {:String => :parse_to_h, :Hash => :write, :SimpleConfig => :passthru}
16
16
  method(m[x.class.to_s.to_sym]).call(x) if x
17
17
  end
18
18
 
@@ -28,10 +28,15 @@ class SimpleConfig
28
28
  private
29
29
 
30
30
  def parse_to_h(s)
31
+
31
32
  txt, _ = RXFHelper.read(s)
32
33
  scan_to_h(txt)
33
34
  end
34
35
 
36
+ def passthru(x)
37
+ initialize x.to_h
38
+ end
39
+
35
40
  def pretty_print(a, indent='')
36
41
 
37
42
  a.map {|x| (x.is_a?(String) or x.nil?) ? x.to_s : pretty_print(x, indent + ' ')}\
@@ -65,7 +70,7 @@ class SimpleConfig
65
70
  if line.join.length > 0 then
66
71
 
67
72
  r2 = if line[0][0][/^\w+: /] then
68
-
73
+
69
74
  scan_to_h(line.join("\n"))
70
75
 
71
76
  else
@@ -82,6 +87,7 @@ class SimpleConfig
82
87
  r3 = {description: txt2, items: h}
83
88
 
84
89
  if remaining then
90
+
85
91
  r3.merge!(scan_to_h remaining + "\n ")
86
92
  end
87
93
 
@@ -115,4 +121,4 @@ class SimpleConfig
115
121
  @to_s = a.join("\n")
116
122
  end
117
123
 
118
- end
124
+ end
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.3.0
4
+ version: 0.3.1
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: 2015-02-02 00:00:00.000000000 Z
34
+ date: 2015-03-29 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: line-tree
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.2.2
83
+ rubygems_version: 2.4.6
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: simple-config
metadata.gz.sig CHANGED
Binary file