ox 2.13.2 → 2.14.2
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 +4 -4
- data/CHANGELOG.md +30 -1
- data/README.md +32 -6
- data/ext/ox/builder.c +5 -1
- data/ext/ox/dump.c +7 -19
- data/ext/ox/extconf.rb +12 -34
- data/ext/ox/gen_load.c +18 -96
- data/ext/ox/hash_load.c +39 -12
- data/ext/ox/obj_load.c +35 -64
- data/ext/ox/ox.c +60 -48
- data/ext/ox/ox.h +7 -15
- data/ext/ox/parse.c +1 -20
- data/ext/ox/sax.c +21 -91
- data/ext/ox/sax.h +1 -3
- data/ext/ox/sax_as.c +2 -6
- data/ext/ox/sax_buf.c +1 -1
- data/lib/ox/element.rb +20 -11
- data/lib/ox/hasattrs.rb +9 -2
- data/lib/ox/version.rb +1 -1
- metadata +6 -6
data/lib/ox/hasattrs.rb
CHANGED
@@ -13,7 +13,7 @@ module Ox
|
|
13
13
|
@attributes = { } if !instance_variable_defined?(:@attributes) or @attributes.nil?
|
14
14
|
@attributes
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
# Returns the value of an attribute.
|
18
18
|
# - +attr+ [Symbol|String] attribute name or key to return the value for
|
19
19
|
def [](attr)
|
@@ -27,9 +27,16 @@ module Ox
|
|
27
27
|
def []=(attr, value)
|
28
28
|
raise "argument to [] must be a Symbol or a String." unless attr.is_a?(Symbol) or attr.is_a?(String)
|
29
29
|
@attributes = { } if !instance_variable_defined?(:@attributes) or @attributes.nil?
|
30
|
+
a_str = attr.to_s
|
31
|
+
a_sym = attr.to_sym
|
32
|
+
if @attributes.has_key?(a_str)
|
33
|
+
attr = a_str
|
34
|
+
elsif @attributes.has_key?(a_sym)
|
35
|
+
attr = a_sym
|
36
|
+
end
|
30
37
|
@attributes[attr] = value.to_s
|
31
38
|
end
|
32
|
-
|
39
|
+
|
33
40
|
# Handles the 'easy' API that allows navigating a simple XML by
|
34
41
|
# referencing attributes by name.
|
35
42
|
# - +id+ [Symbol] element or attribute name
|
data/lib/ox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: "A fast XML parser and object serializer that uses only standard C lib.\n\nOptimized
|
14
14
|
XML (Ox), as the name implies was written to provide speed optimized\nXML handling.
|
@@ -76,7 +76,7 @@ homepage: http://www.ohler.com/ox
|
|
76
76
|
licenses:
|
77
77
|
- MIT
|
78
78
|
metadata: {}
|
79
|
-
post_install_message:
|
79
|
+
post_install_message:
|
80
80
|
rdoc_options:
|
81
81
|
- "--main"
|
82
82
|
- README.md
|
@@ -98,8 +98,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
|
-
rubygems_version: 3.
|
102
|
-
signing_key:
|
101
|
+
rubygems_version: 3.2.3
|
102
|
+
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: A fast XML parser and object serializer.
|
105
105
|
test_files: []
|