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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8715dbba0c19b07cfea4744aa080a2df0dcc402d
4
- data.tar.gz: a0d5a5c30764891dc5a4b6d794be191ded65bded
2
+ SHA256:
3
+ metadata.gz: 6f441ea6ddce1f32eefcb965b6c4e3188ba70217a363433044b425ee4ba5aaf7
4
+ data.tar.gz: 0ebf4f7fd0919509aa7fa12488ac17c66322fd6c53c4b8c541087bb50c190501
5
5
  SHA512:
6
- metadata.gz: 9e1b7bde79d987845bfa44a7e474305206bf724b3a265ce3e11cb24145a5ec426d8039fbbab3121a1fa8509574917f3d1535898b6c5db1a157a5184751b8be71
7
- data.tar.gz: 98deca942d679ec338f1ee3ac794b8af9c3e6915e82df01c17e1b5847774f5112b333ab39766cb100752e0fa4cdb734782715e5b4b4218ce01886f7ded2707f8
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
- # NOTE In JRuby 9.0.4.0+ and Nokogiri version 1.6.8, Nokogiri::XML::Builder::NodeBuilder
691
- # does not retain the XML namespace prefix for an element when adding an element
692
- # to a parent node.
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 JRuby workaround is intended for XML element prefixes that originate from a
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
@@ -1,3 +1,3 @@
1
1
  module XmlMapper
2
- VERSION = "0.7.3"
2
+ VERSION = '0.8.0'.freeze
3
3
  end
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.7.3
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
- rubyforge_project:
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.