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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f66978b87b2aae7cb34b029f8a03a5f7bafdf88ca2e5f8323a72ac191e8f988a
4
- data.tar.gz: 8181a385f4ae1421b21ad936c92ec80e5fcaba6d50bb24ec34a4f90dff317f87
3
+ metadata.gz: 97fcb1a62067bc5b89b5d87f21fadeef568fc3ff077562f5b283a8ff01ed0e0e
4
+ data.tar.gz: 3da26b22a552c6f1009593e163b77b26eee204758fb13af7a978a936247dc192
5
5
  SHA512:
6
- metadata.gz: 3b8fed912eaf70837fce79caa564dbf549b4158b686d21168dd3383670d9c1f0ceb90a2dd8e7de048991320f168d21ed21e42a5083f0524096df4dd8a62a690d
7
- data.tar.gz: 107b632e4cad49d118370b155d076715f55d5e1b1f9893a8bd33a57e0e09a82061fce9557447bc08241eccfd2ab643409847571e9a810ea03f3e43898506558e
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
- ## [Unreleased]
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
- [![Build Status](https://secure.travis-ci.org/ohler55/ox.svg?branch=master)](http://travis-ci.org/ohler55/ox) [![TideLift](https://tidelift.com/badges/github/ohler55/ox)](https://tidelift.com/subscription/pkg/rubygems-ox?utm_source=rubygems-ox&utm_medium=referral&utm_campaign=readme)
5
- [![Financial Contributors on Open Collective](https://opencollective.com/ohler/all/badge.svg?label=financial+contributors)](https://opencollective.com/ohler)
4
+ [![Build status](https://ci.appveyor.com/api/projects/status/pg2w4wspbrflbi8c?svg=true)](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
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Ox
3
3
  # Current version of the module.
4
- VERSION = '2.14.1'
4
+ VERSION = '2.14.2'
5
5
  end
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.1
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-01-11 00:00:00.000000000 Z
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.