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 +4 -4
- data/lib/tilia/xml/service.rb +2 -2
- data/lib/tilia/xml/version.rb +1 -1
- data/lib/tilia/xml.rb +8 -0
- data/test/xml/service_test.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28be5b537419a6fafec89b07fefe33804b849b9e
|
4
|
+
data.tar.gz: e4add19ea231c5f6ba8940249797be097803dc1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b5dea05efe58faa1c195df67b00cf19fa186da0edde4db221d4ea7da6c08ad2be921af7f27e65cd74b80914917eab29750c9cf131e5f4b153f22fb99a54c065
|
7
|
+
data.tar.gz: 284d2411eee690d48bfa30790a116e08bf9db3f7de7f430388cdbb25b597fbc18a19af31ef486509f87e0d6d959bc738b265901bb93a677d9d834411ba1341a6
|
data/lib/tilia/xml/service.rb
CHANGED
@@ -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 =
|
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.
|
70
|
+
root_element_name.value = result['name']
|
71
71
|
result['value']
|
72
72
|
end
|
73
73
|
|
data/lib/tilia/xml/version.rb
CHANGED
data/lib/tilia/xml.rb
CHANGED
data/test/xml/service_test.rb
CHANGED
@@ -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.
|
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:
|
11
|
+
date: 2016-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|