tilia-xml 1.2.0.1 → 1.2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca4ea461bc07c46f7aa4d5b7841dc8623993104f
4
- data.tar.gz: d6da6f89b94922851285be87cd666337bd59e52c
3
+ metadata.gz: 28be5b537419a6fafec89b07fefe33804b849b9e
4
+ data.tar.gz: e4add19ea231c5f6ba8940249797be097803dc1d
5
5
  SHA512:
6
- metadata.gz: 86545a5d181aa7074d4382c1f9da823ae4a0603e35d09c54dfacccdcb4f2280290d5b889b869648d827c863dff45175441ba56d9df38d447f5f0b27bf8d445ab
7
- data.tar.gz: dc3426d96c5e9654cc5c2e430046cd13c53e249bbf78e4b3280a90a71b28be18fb01d44fd6639d619c7061ae7775ceade9912eb189a028490eba96a7ba02fce7
6
+ metadata.gz: 1b5dea05efe58faa1c195df67b00cf19fa186da0edde4db221d4ea7da6c08ad2be921af7f27e65cd74b80914917eab29750c9cf131e5f4b153f22fb99a54c065
7
+ data.tar.gz: 284d2411eee690d48bfa30790a116e08bf9db3f7de7f430388cdbb25b597fbc18a19af31ef486509f87e0d6d959bc738b265901bb93a677d9d834411ba1341a6
@@ -60,14 +60,14 @@ module Tilia
60
60
  # @param [String, nil] root_element_name
61
61
  # @raise [ParseException]
62
62
  # @return [Array, Object, String]
63
- def parse(input, context_uri = nil, root_element_name = nil)
63
+ def parse(input, context_uri = nil, root_element_name = Box.new)
64
64
  # Skip php short commings
65
65
  reader = self.reader
66
66
  reader.context_uri = context_uri
67
67
  reader.xml(input)
68
68
 
69
69
  result = reader.parse
70
- root_element_name.replace(result['name'])
70
+ root_element_name.value = result['name']
71
71
  result['value']
72
72
  end
73
73
 
@@ -3,7 +3,7 @@ module Tilia
3
3
  # This class contains the version number for this package.
4
4
  class Version
5
5
  # Full version number
6
- VERSION = '1.2.0.1'
6
+ VERSION = '1.2.0.2'
7
7
  end
8
8
  end
9
9
  end
data/lib/tilia/xml.rb CHANGED
@@ -20,4 +20,12 @@ module Tilia
20
20
  require 'tilia/xml/version'
21
21
  require 'tilia/xml/writer'
22
22
  end
23
+
24
+ class Box
25
+ attr_accessor :value
26
+
27
+ def initialize(v = nil)
28
+ @value = v
29
+ end
30
+ end
23
31
  end
@@ -34,9 +34,9 @@ module Tilia
34
34
  <child>value</child>
35
35
  </root>
36
36
  XML
37
- root_element = ''
37
+ root_element = Box.new('')
38
38
  result = @util.parse(xml, nil, root_element)
39
- assert_equal('{http://sabre.io/ns}root', root_element)
39
+ assert_equal('{http://sabre.io/ns}root', root_element.value)
40
40
 
41
41
  expected = [
42
42
  {
@@ -59,9 +59,9 @@ XML
59
59
  stream.write xml
60
60
  stream.rewind
61
61
 
62
- root_element = ''
62
+ root_element = Box.new('')
63
63
  result = @util.parse(stream, nil, root_element)
64
- assert_equal('{http://sabre.io/ns}root', root_element)
64
+ assert_equal('{http://sabre.io/ns}root', root_element.value)
65
65
 
66
66
  expected = [
67
67
  {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tilia-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.1
4
+ version: 1.2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakob Sack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-25 00:00:00.000000000 Z
11
+ date: 2016-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport