simple-config 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/simple-config.rb +6 -5
- metadata +2 -2
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55c903999f63fda86117d56cde5c29b21602a2ae
|
4
|
+
data.tar.gz: 8cdc62b5eba092b4db60ab1c359c874c6f9b211a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 756bdf86272c60c1caf23c76559db8f8d3217b3ac66ce7c0cb5e1b2057414efe436466a2a3a5f3a542518354d075bf5a47e97c6ca0a7c0e13b0be49553c7e894
|
7
|
+
data.tar.gz: ef7914457cdcaf8f12e2bc8fd48f51f5dfd0185daafe19ce7bfc71e34c9e748c6e3b7d1709eaf9af292ebac53a010e7facc56736ee0e9ad966d2fdfa8d68d7b5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/simple-config.rb
CHANGED
@@ -10,10 +10,12 @@ class SimpleConfig
|
|
10
10
|
|
11
11
|
attr_reader :to_h, :to_s
|
12
12
|
|
13
|
-
def initialize(x=nil)
|
13
|
+
def initialize(x=nil, attributes: {})
|
14
14
|
|
15
15
|
@header = false
|
16
|
+
@attributes = attributes
|
16
17
|
m = {:String => :parse_to_h, :Hash => :write, :SimpleConfig => :passthru}
|
18
|
+
|
17
19
|
method(m[x.class.to_s.to_sym]).call(x) if x
|
18
20
|
end
|
19
21
|
|
@@ -30,7 +32,7 @@ class SimpleConfig
|
|
30
32
|
if @header then
|
31
33
|
|
32
34
|
header = '<?simple-config'
|
33
|
-
header += ' ' + @
|
35
|
+
header += ' ' + @attributes.map {|x| "%s='%s'" % x }.join(' ')
|
34
36
|
header += "?>\n"
|
35
37
|
end
|
36
38
|
|
@@ -42,8 +44,7 @@ class SimpleConfig
|
|
42
44
|
|
43
45
|
make_xml(@to_h)
|
44
46
|
|
45
|
-
|
46
|
-
a = ['simpleconfig', attributes, '', *make_xml(@to_h)]
|
47
|
+
a = ['simpleconfig', @attributes, '', *make_xml(@to_h)]
|
47
48
|
Rexle.new(a).xml(options)
|
48
49
|
|
49
50
|
end
|
@@ -69,7 +70,7 @@ class SimpleConfig
|
|
69
70
|
|
70
71
|
txt = if a[0][/^<\?simple-?config /] then
|
71
72
|
raw_header = a.shift
|
72
|
-
@type
|
73
|
+
@attributes.merge! type: raw_header[/type=["']([^"']+)/,1]
|
73
74
|
@header = true
|
74
75
|
a.join
|
75
76
|
else
|
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.4.
|
4
|
+
version: 0.4.2
|
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-04-
|
34
|
+
date: 2015-04-23 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: line-tree
|
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
����O+1{/Ƣ��=jQ��I�cD�(����~rtтѺ�;�;ޖ�h̄GFxR��[η��25/�X��C��%��Ӓ�<���f)wB�o~�&S�/W*����/h6�.!�Q6/��Kz��"c���E2��(���9.�ZI��|/I�\�M���k4Ne�~���,��y�w��c~
|