ox 2.14.1 → 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 +6 -1
- data/README.md +1 -2
- data/lib/ox/hasattrs.rb +9 -2
- data/lib/ox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97fcb1a62067bc5b89b5d87f21fadeef568fc3ff077562f5b283a8ff01ed0e0e
|
4
|
+
data.tar.gz: 3da26b22a552c6f1009593e163b77b26eee204758fb13af7a978a936247dc192
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dcaafdffe911c917c12e44e45f02ab100489a98d3f19df67a1131743141e0efb8dacb3d695e9f0b965d7813b91cadd15faa4375aab886fceff37cd9a9d6e404
|
7
|
+
data.tar.gz: e7701c3e41d8f6701bcc44f74fffd540cac3c525192531e652d6c2508b1a0c72dbd21d344e1e2f431683714ea5cf23eefa1da80c97dfa32d509df496ae0bf5c2
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,12 @@
|
|
2
2
|
|
3
3
|
All changes to the Ox gem are documented here. Releases follow semantic versioning.
|
4
4
|
|
5
|
-
## [
|
5
|
+
## [2.14.2] - 2021-03-07
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
- Attribute keys for setting attributes no longer create seemily
|
10
|
+
duplicates if symbol and string keys are mixed.
|
6
11
|
|
7
12
|
## [2.14.1] - 2021-01-11
|
8
13
|
|
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
# Ox gem
|
2
2
|
A fast XML parser and Object marshaller as a Ruby gem.
|
3
3
|
|
4
|
-
[](https://opencollective.com/ohler)
|
4
|
+
[](https://ci.appveyor.com/project/ohler55/ox)
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
gem install ox
|
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.14.
|
4
|
+
version: 2.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
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.
|