xmlmapper 0.7.3 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/xmlmapper.rb +7 -5
- data/lib/xmlmapper/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6f441ea6ddce1f32eefcb965b6c4e3188ba70217a363433044b425ee4ba5aaf7
|
4
|
+
data.tar.gz: 0ebf4f7fd0919509aa7fa12488ac17c66322fd6c53c4b8c541087bb50c190501
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ee1dad25a3fb5654c6a49d0c4d34fc466f65968c1b123b5eeb77007097d0b7ceaa47fa78c896f7f65f2d91bab3c97c1448bf9aa93edfc162388940b5ff5633a
|
7
|
+
data.tar.gz: af8e018ec9910204b0465113f886e8f2c900e822058227e8841ab2b970984d46b8d0943eed6bad643dda635ef1fb7d0c8c43ac04030ab8a9977a1c6a9ff9fe33
|
data/lib/xmlmapper.rb
CHANGED
@@ -687,14 +687,16 @@ module XmlMapper
|
|
687
687
|
# an empty element will be written to the xml
|
688
688
|
#
|
689
689
|
if value.nil? && element.options[:single] && element.options[:state_when_nil]
|
690
|
-
#
|
691
|
-
#
|
692
|
-
#
|
690
|
+
#
|
691
|
+
# NOTE
|
692
|
+
# In JRuby 9.0.4.0+ and Nokogiri version 1.6.8 or with Nokogiri version >= 1.12.0 (libxml >= 2.9.12),
|
693
|
+
# the Nokogiri::XML::Builder::NodeBuilder does not retain the XML namespace prefix for an element
|
694
|
+
# when adding an element to a parent node.
|
693
695
|
#
|
694
696
|
# The namespace prefix must be specified when adding the node to its parent.
|
695
697
|
# This issue manifests when setting an element's :state_when_nil' option to true.
|
696
698
|
#
|
697
|
-
# This
|
699
|
+
# This workaround is intended for XML element prefixes that originate from a
|
698
700
|
# single namespace defined in 'registered_namespaces'. If there are
|
699
701
|
# multiple namespaces defined in the 'registered_namespaces' array,
|
700
702
|
# then the first namespace is selected.
|
@@ -707,7 +709,7 @@ module XmlMapper
|
|
707
709
|
# 3. Adding namespace-less node to namespaced parent attaches the parent namespace to the child
|
708
710
|
# https://github.com/sparklemotion/nokogiri/issues/425
|
709
711
|
#
|
710
|
-
if RUBY_ENGINE == 'jruby' && !registered_namespaces.empty?
|
712
|
+
if (RUBY_ENGINE == 'jruby' || Nokogiri.uses_libxml?('>= 2.9.12')) && !registered_namespaces.empty?
|
711
713
|
ns = registered_namespaces.keys.first.to_sym
|
712
714
|
xml[ns].send("#{tag}_","")
|
713
715
|
else
|
data/lib/xmlmapper/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xmlmapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damien Le Berrigaud
|
@@ -129,8 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
|
133
|
-
rubygems_version: 2.5.1
|
132
|
+
rubygems_version: 3.1.4
|
134
133
|
signing_key:
|
135
134
|
specification_version: 3
|
136
135
|
summary: Provides a simple way to map XML to Ruby Objects and back again.
|