simple-config 0.5.0 → 0.6.0
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 +3 -29
- metadata +6 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23c29bab5b256f56259d7f4396c9b09f4404c335
|
4
|
+
data.tar.gz: 966a5807b1906431261264dd000ecf7f80ff85c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b8f869ca27091cf89691b42e182eb7ac04317506d63072fc3b99207ebe0bee8816044b34359f2b35a24ba75d60df3c790193e773e2e875cab5a886af1e9df62
|
7
|
+
data.tar.gz: 0976053bf5a997d46a0e48c8b65dd1c20b6c5b614dda2d054d416ce7c1943bef6f4c3521e37eeadfbab843e714cf2eaf166e2e3ba4e1a868c96430b48abe4da4
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/simple-config.rb
CHANGED
@@ -7,10 +7,11 @@ require 'kvx'
|
|
7
7
|
|
8
8
|
class SimpleConfig < Kvx
|
9
9
|
|
10
|
-
attr_reader :to_h, :to_s
|
11
10
|
|
12
11
|
def initialize(x, attributes: {})
|
13
12
|
|
13
|
+
@identifier = 'simple-config'
|
14
|
+
|
14
15
|
if x.is_a? SimpleConfig then
|
15
16
|
@to_h = x.to_h
|
16
17
|
elsif x
|
@@ -19,22 +20,7 @@ class SimpleConfig < Kvx
|
|
19
20
|
|
20
21
|
end
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
@to_h = h || @to_h
|
25
|
-
|
26
|
-
header = ''
|
27
|
-
|
28
|
-
if @header then
|
29
|
-
|
30
|
-
header = '<?simple-config'
|
31
|
-
header += ' ' + @attributes.map {|x| "%s='%s'" % x }.join(' ')
|
32
|
-
header += "?>\n"
|
33
|
-
end
|
34
|
-
|
35
|
-
@to_s = header + scan_to_s(@to_h)
|
36
|
-
|
37
|
-
end
|
23
|
+
alias write to_s
|
38
24
|
|
39
25
|
private
|
40
26
|
|
@@ -42,17 +28,5 @@ class SimpleConfig < Kvx
|
|
42
28
|
super(s, header_pattern: %r(^<\?simple-?config ))
|
43
29
|
end
|
44
30
|
|
45
|
-
def scan_to_s(h, indent='')
|
46
|
-
|
47
|
-
a = h.inject([]) do |r, x|
|
48
|
-
if x.last.is_a? Hash then
|
49
|
-
r << x.first.to_s + ":\n" + scan_to_s(x.last, ' ')
|
50
|
-
else
|
51
|
-
r << "%s%s: %s" % [indent, *x]
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
@to_s = a.join("\n")
|
56
|
-
end
|
57
31
|
|
58
32
|
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.
|
4
|
+
version: 0.6.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: 2015-04-
|
34
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: kvx
|
@@ -39,20 +39,20 @@ dependencies:
|
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '0.
|
42
|
+
version: '0.2'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
45
|
+
version: 0.2.0
|
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.
|
52
|
+
version: '0.2'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.
|
55
|
+
version: 0.2.0
|
56
56
|
description:
|
57
57
|
email: james@r0bertson.co.uk
|
58
58
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|