kvx 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/kvx.rb +40 -21
  5. metadata +2 -2
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65e9a48bcfcc5a08d464590fcf33594ba71e37fd
4
- data.tar.gz: 2a691c71a48ba3c1c9885f92f462b916424982b2
3
+ metadata.gz: e49c700e1d486c91712fab94f7f9e1c0f5fbf4ad
4
+ data.tar.gz: 36cd1ccb43dab8a9dbfc41759f2be874ed744e35
5
5
  SHA512:
6
- metadata.gz: aed7980cf2f6e09945f25c0105fac06f4c8d5dd6387769efbde0dc2c55f0ccea4a63ba6e598a031d3fb8592e919c31ee2deea58f9393263ed06e07df16e48b40
7
- data.tar.gz: 196e8405b49eb286b95fc72206920cdc5dee82a8e3ea80301fc7e5b73b8e0683798a9d81c24e783f3b432f8a122d4fbfc493d68c836f86191f75b5baf7872a16
6
+ metadata.gz: 36f2ebc03b732e3aff17822f834d9ee4c8b9219387d559a46447fbd7fc63adb4a33f72127c697549e4c62466e3c0e79bc4241beb7d372d3bc323c2af3d84c431
7
+ data.tar.gz: 24bee384988676c48fc8e1f69c7585faf2c3e0626b63ad5fe109e9bb371d3a8451097061450b0688ca824021e6a94e06209889c51dc7f6a8e481a499f4b80825
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/kvx.rb CHANGED
@@ -51,27 +51,8 @@ class Kvx
51
51
 
52
52
  end
53
53
 
54
- def to_s()
55
-
56
- header = ''
57
-
58
- if @header or @summary then
59
-
60
- attr = @attributes ? ' ' + @attributes\
61
- .map {|x| "%s='%s'" % x }.join(' ') : ''
62
- header = '<?' + @identifier
63
- header += attr
64
- header += "?>\n"
65
- header += scan_to_s @summary
66
- header += "\n----------------------------------\n\n"
67
- end
54
+ def to_doc()
68
55
 
69
- header + scan_to_s(@body)
70
-
71
- end
72
-
73
- def to_xml(options={pretty: true})
74
-
75
56
  if @summary.empty? then
76
57
 
77
58
  a = [self.class.to_s.downcase, @attributes, '', *make_xml(@body)]
@@ -91,9 +72,35 @@ class Kvx
91
72
  body = [:body, {}, *make_xml(@body)]
92
73
  a = [self.class.to_s.downcase, @attributes, '', summary, body]
93
74
 
75
+ Rexle.new(a)
76
+
77
+ end
78
+
79
+ end
80
+
81
+ def to_s()
82
+
83
+ header = ''
84
+
85
+ if @header or @summary then
86
+
87
+ attr = @attributes ? ' ' + @attributes\
88
+ .map {|x| "%s='%s'" % x }.join(' ') : ''
89
+ header = '<?' + @identifier
90
+ header += attr
91
+ header += "?>\n"
92
+ header += scan_to_s @summary
93
+ header += "\n----------------------------------\n\n"
94
94
  end
95
95
 
96
- Rexle.new(a).xml(options)
96
+ header + scan_to_s(@body)
97
+
98
+ end
99
+
100
+ def to_xml(options={pretty: true})
101
+
102
+ doc = self.to_doc
103
+ doc.xml(options)
97
104
 
98
105
  end
99
106
 
@@ -289,7 +296,19 @@ class Kvx
289
296
  def xml_to_h(node)
290
297
 
291
298
  summary = node.element('summary')
299
+
292
300
  if summary then
301
+
302
+ etags = summary.element 'tags'
303
+
304
+ if etags then
305
+
306
+ tags = etags.xpath('tag/text()')
307
+ etags.delete 'tag'
308
+ etags.text = tags.join(' ') if tags.any?
309
+
310
+ end
311
+
293
312
  @summary = hashify(summary)[:summary]
294
313
  @body = hashify(node.element('body'))[:body]
295
314
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kvx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  Vo86eJaJUXJbywrm97pYB2utyzWPyxJihIh0eFuNbCk+XOWfv6vUEyuXMiCsiyrF
32
32
  azRHJ6uLeQu4hw==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-05-05 00:00:00.000000000 Z
34
+ date: 2015-05-11 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