simple-config 0.1.12 → 0.1.13

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: e5577c4a063185bc438d6087e58833990fc183f4
4
- data.tar.gz: 2261d405f7135e9cd244f9f6823ae997e689f9c8
3
+ metadata.gz: 786fea737e4806f56063629c07c4d26dab04257a
4
+ data.tar.gz: 9bede00456cb6cdaa5db393efcd7ca07d9e12af0
5
5
  SHA512:
6
- metadata.gz: a8c6bf060bc38ec46d736a0df73c624780680fcf00970ff545a7f54bb8fb3be7b80764f91a01fbab76c4cd1d620d9b4f1814c44a6fc1b26924c588b37b4ab062
7
- data.tar.gz: e557f639e6dac142c5052f6bf3af4b7702f8eaaf89aeb12c71f93a151302421ef50bfc46eb828e619cdcca98191ac1b21b9dc130909905abb01df378914f1f2a
6
+ metadata.gz: 6fa8a79b0b045b929e5c9137df2a4e6a52965cea0224e9ee32d1e3f944d9f84bc9127dbc9eb267e6b5695802e28e8841621c139fe76d9d7c6a0eef43b4779d8b
7
+ data.tar.gz: a6fcc2bc442a561cb2bb37eafc2647368140e856153603c92530fc0428baaf5d2adedffb9cac6730cf8e94ca8556cda75554753f15e08c119b4ace7c14ad1844
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -11,6 +11,7 @@ class SimpleConfig
11
11
  attr_reader :to_h, :to_s
12
12
 
13
13
  def initialize(x=nil)
14
+
14
15
  m = {:String => :scan_to_h, :Hash => :scan_to_s}
15
16
  method(m[x.class.to_s.to_sym]).call(x) if x
16
17
  end
@@ -44,14 +45,22 @@ class SimpleConfig
44
45
 
45
46
  if line.any? then
46
47
 
47
- r2 = if line[0][0][/^\w+:/] then
48
+ r2 = if line[0][0][/^\w+: /] then
49
+
48
50
  scan_to_h(line.join("\n"))
51
+
49
52
  else
50
53
 
51
- desc = pretty_print(line).split(/\n(?=\w+:)/)
52
- txt, remaining = desc
54
+ desc = pretty_print(line).split(/\n(?=\w+: )/)
53
55
 
54
- r3 = {description: txt, items: txt.lines.map(&:chomp)}
56
+ txt2, remaining = desc
57
+
58
+ h = txt2.lines.inject([]) do |r, x|
59
+ x.chomp!
60
+ x.length > 0 ? r << x : r
61
+ end
62
+
63
+ r3 = {description: txt2, items: h}
55
64
 
56
65
  if remaining then
57
66
  r3.merge!(scan_to_h remaining + "\n ")
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.12
4
+ version: 0.1.13
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-05 00:00:00.000000000 Z
34
+ date: 2014-11-06 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