ox 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of ox might be problematic. Click here for more details.
- data/README.md +3 -7
- data/ext/ox/dump.c +1 -0
- data/lib/ox/element.rb +4 -3
- data/lib/ox/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -34,15 +34,11 @@ A fast XML parser and Object marshaller as a Ruby gem.
|
|
34
34
|
|
35
35
|
## <a name="release">Release Notes</a>
|
36
36
|
|
37
|
-
### Release 1.8.
|
37
|
+
### Release 1.8.2
|
38
38
|
|
39
|
-
-
|
39
|
+
- Ox::Element.locate no longer raises and exception if there are no child nodes.
|
40
40
|
|
41
|
-
-
|
42
|
-
|
43
|
-
### Release 1.8.0
|
44
|
-
|
45
|
-
- Added more complete support for processing instructions in both the generic parser and in the sax parser. This change includes and additional sax handler callback for the end of the instruction processing.
|
41
|
+
- Dumping an XML document no longer puts a carriage return after processing instructions.
|
46
42
|
|
47
43
|
## <a name="description">Description</a>
|
48
44
|
|
data/ext/ox/dump.c
CHANGED
@@ -1115,6 +1115,7 @@ dump_gen_nodes(VALUE obj, unsigned int depth, Out out) {
|
|
1115
1115
|
dump_gen_element(*np, d2, out);
|
1116
1116
|
} else if (ox_instruct_clas == clas) {
|
1117
1117
|
dump_gen_instruct(*np, d2, out);
|
1118
|
+
indent_needed = (1 == cnt) ? 0 : 1;
|
1118
1119
|
} else if (rb_cString == clas) {
|
1119
1120
|
dump_str_value(out, StringValuePtr(*np), RSTRING_LEN(*np));
|
1120
1121
|
indent_needed = (1 == cnt) ? 0 : 1;
|
data/lib/ox/element.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
module Ox
|
3
2
|
|
4
3
|
# An Element represents a element of an XML document. It has a name,
|
@@ -54,12 +53,14 @@ module Ox
|
|
54
53
|
@nodes
|
55
54
|
end
|
56
55
|
|
57
|
-
# Appends a Node to the Element's nodes array.
|
56
|
+
# Appends a Node to the Element's nodes array. Returns the element itself
|
57
|
+
# so multiple appends can be chained together.
|
58
58
|
# @param [Node] node Node to append to the nodes array
|
59
59
|
def <<(node)
|
60
60
|
@nodes = [] if !instance_variable_defined?(:@nodes) or @nodes.nil?
|
61
61
|
raise "argument to << must be a String or Ox::Node." unless node.is_a?(String) or node.is_a?(Node)
|
62
62
|
@nodes << node
|
63
|
+
self
|
63
64
|
end
|
64
65
|
|
65
66
|
# Returns true if this Object and other are of the same type and have the
|
@@ -178,7 +179,7 @@ module Ox
|
|
178
179
|
if '?' == name or '*' == name
|
179
180
|
match = nodes
|
180
181
|
else
|
181
|
-
match =
|
182
|
+
match = nodes.select { |e| e.is_a?(Element) and name == e.name }
|
182
183
|
end
|
183
184
|
unless qual.nil? or match.empty?
|
184
185
|
case qual
|
data/lib/ox/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! "A fast XML parser and object serializer that uses only standard C
|
15
15
|
lib.\n \nOptimized XML (Ox), as the name implies was written to provide
|