simple-config 0.5.0 → 0.6.0

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: dce3c2ab92ee77d32c17b1c3abe116e4d4cba0f9
4
- data.tar.gz: 9b254b3f942de43f03ff643bac88fcd703357d82
3
+ metadata.gz: 23c29bab5b256f56259d7f4396c9b09f4404c335
4
+ data.tar.gz: 966a5807b1906431261264dd000ecf7f80ff85c4
5
5
  SHA512:
6
- metadata.gz: 0634a4869c480a9eb2e72cec6e2bba51f1855b2bc3b906e2c474200fe40fe45c7f89557e4787d1bea720cb020722dfca906efe3b6a057f48ee0d5f63ac86c51a
7
- data.tar.gz: 6e75f0a78aac472b5f670347c96dd9844a4dc04548105a9ff7444ad7fb7f7d98d01322c490341b4ba5bfbb78336a9f0256ee48b34bf9276a8d37f0fd21ccecc2
6
+ metadata.gz: 9b8f869ca27091cf89691b42e182eb7ac04317506d63072fc3b99207ebe0bee8816044b34359f2b35a24ba75d60df3c790193e773e2e875cab5a886af1e9df62
7
+ data.tar.gz: 0976053bf5a997d46a0e48c8b65dd1c20b6c5b614dda2d054d416ce7c1943bef6f4c3521e37eeadfbab843e714cf2eaf166e2e3ba4e1a868c96430b48abe4da4
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
- def write(h=nil, header: @header)
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.5.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-24 00:00:00.000000000 Z
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.1'
42
+ version: '0.2'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.1.2
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.1'
52
+ version: '0.2'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.1.2
55
+ version: 0.2.0
56
56
  description:
57
57
  email: james@r0bertson.co.uk
58
58
  executables: []
metadata.gz.sig CHANGED
Binary file