Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-xml-simple for openSUSE:Factory checked in at 2021-01-20 18:29:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-xml-simple (Old) and /work/SRC/openSUSE:Factory/.rubygem-xml-simple.new.28504 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-xml-simple" Wed Jan 20 18:29:23 2021 rev:3 rq:865020 version:1.1.8 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-xml-simple/rubygem-xml-simple.changes 2015-03-03 11:15:37.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-xml-simple.new.28504/rubygem-xml-simple.changes 2021-01-20 18:29:35.395636971 +0100 @@ -1,0 +2,6 @@ +Wed Jan 20 13:37:21 UTC 2021 - Stephan Kulow <[email protected]> + +updated to version 1.1.8 + no changelog found + +------------------------------------------------------------------- Old: ---- xml-simple-1.1.5.gem New: ---- xml-simple-1.1.8.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-xml-simple.spec ++++++ --- /var/tmp/diff_new_pack.s8zlnE/_old 2021-01-20 18:29:36.003637553 +0100 +++ /var/tmp/diff_new_pack.s8zlnE/_new 2021-01-20 18:29:36.007637557 +0100 @@ -1,7 +1,7 @@ # # spec file for package rubygem-xml-simple # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -24,7 +24,7 @@ # Name: rubygem-xml-simple -Version: 1.1.5 +Version: 1.1.8 Release: 0 %define mod_name xml-simple %define mod_full_name %{mod_name}-%{version} @@ -32,11 +32,11 @@ BuildRequires: %{rubygem gem2rpm} BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 -Url: https://github.com/maik/xml-simple -Source: http://rubygems.org/gems/%{mod_full_name}.gem +URL: https://github.com/maik/xml-simple +Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: A simple API for XML processing -License: Ruby +License: MIT Group: Development/Languages/Ruby %description ++++++ xml-simple-1.1.5.gem -> xml-simple-1.1.8.gem ++++++ Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/xmlsimple.rb new/lib/xmlsimple.rb --- old/lib/xmlsimple.rb 2015-03-01 15:34:28.000000000 +0100 +++ new/lib/xmlsimple.rb 2020-12-29 16:21:28.000000000 +0100 @@ -1,7 +1,7 @@ # = XmlSimple # # Author:: Maik Schmidt <[email protected]> -# Copyright:: Copyright (c) 2003-2014 Maik Schmidt +# Copyright:: Copyright (c) 2003-2020 Maik Schmidt # License:: Distributes under the same terms as Ruby. # require 'rexml/document' @@ -11,7 +11,7 @@ class XmlSimple include REXML - @@VERSION = '1.1.5' + @@VERSION = '1.1.8' # A simple cache for XML documents that were already transformed # by xml_in. @@ -267,12 +267,12 @@ keyattr keeproot forcecontent contentkey noattr searchpath forcearray suppressempty anonymoustag cache grouptags normalisespace normalizespace variables varattr keytosymbol - attrtosymbol attrprefix conversions + attrtosymbol attrprefix conversions kebabtosnakecase ), 'out' => %w( keyattr keeproot contentkey noattr rootname xmldeclaration outputfile noescape suppressempty - anonymoustag indent grouptags noindent attrprefix + anonymoustag indent grouptags noindent attrprefix selfclose ) } @@ -286,6 +286,7 @@ DEF_INDENTATION = ' ' DEF_KEY_TO_SYMBOL = false DEF_ATTR_TO_SYMBOL = false + DEF_KEBAB_TO_SNAKE = false # Normalizes option names in a hash, i.e., turns all # characters to lower case and removes all underscores. @@ -454,6 +455,8 @@ elsif @options.has_key?('varattr') @_var_values = {} end + + @options['kebabtosnakecase'] = DEF_KEBAB_TO_SNAKE unless @options.has_key?('kebabtosnakecase') end # Actually converts an XML document element into a data structure. @@ -482,7 +485,7 @@ result[@options['contentkey']] = content end elsif element.has_text? # i.e. it has only text. - return collapse_text_node(result, element) + return collapse_text_node(result, element) # calls merge, which converts end # Turn Arrays into Hashes if key fields present. @@ -491,8 +494,11 @@ # Disintermediate grouped tags. if @options.has_key?('grouptags') result.each { |key, value| + # In results, key should already be converted + raise("Unconverted key '#{key}' found. Should be '#{kebab_to_snake_case key}'.") if (key != kebab_to_snake_case(key)) next unless (value.is_a?(Hash) && (value.size == 1)) child_key, child_value = value.to_a[0] + child_key = kebab_to_snake_case child_key # todo test whether necessary if @options['grouptags'][key] == child_key result[key] = child_value end @@ -548,6 +554,7 @@ keyattr = @options['keyattr'] if (keyattr.is_a?(Array) || keyattr.is_a?(Hash)) hash.each { |key, value| + key = kebab_to_snake_case key if value.is_a?(Array) if keyattr.is_a?(Array) hash[key] = fold_array(value) @@ -644,6 +651,7 @@ # value:: # Value to be associated with key. def merge(hash, key, value) + key = kebab_to_snake_case key if value.is_a?(String) value = normalise_space(value) if @options['normalisespace'] == 2 @@ -658,7 +666,7 @@ # look for variable definitions if @options.has_key?('varattr') - varattr = @options['varattr'] + varattr = kebab_to_snake_case @options['varattr'] if hash.has_key?(varattr) set_var(hash[varattr], value) end @@ -712,12 +720,12 @@ def get_attributes(node) attributes = {} if @options['attrprefix'] - node.attributes.each { |n,v| attributes["@" + n] = v } + node.attributes.each { |n,v| attributes["@" + kebab_to_snake_case(n)] = v } elsif @options.has_key?('attrtosymbol') and @options['attrtosymbol'] == true #patch for converting attribute names to symbols - node.attributes.each { |n,v| attributes[n.to_sym] = v } + node.attributes.each { |n,v| attributes[kebab_to_snake_case(n).to_sym] = v } else - node.attributes.each { |n,v| attributes[n] = v } + node.attributes.each { |n,v| attributes[kebab_to_snake_case(n)] = v } end attributes @@ -827,7 +835,7 @@ end end } - else + elsif !@options['selfclose'] text_content = '' end @@ -1035,6 +1043,20 @@ } end end + + # Substitutes underscores for hyphens if the KebabToSnakeCase option is selected. For when you don't + # want to refer to keys by hash[:'my-key'] but instead as hash[:my_key] + # + # key:: + # Key to be converted. + def kebab_to_snake_case(key) + return key unless (@options['kebabtosnakecase']) + + is_symbol = key.is_a? Symbol + key = key.to_s.gsub(/-/, '_') + key = key.to_sym if is_symbol + key + end end # vim:sw=2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2015-03-01 15:34:28.000000000 +0100 +++ new/metadata 2020-12-29 16:21:28.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: xml-simple version: !ruby/object:Gem::Version - version: 1.1.5 + version: 1.1.8 platform: ruby authors: - Maik Schmidt autorequire: bindir: bin cert_chain: [] -date: 2014-10-30 00:00:00.000000000 Z +date: 2020-12-22 00:00:00.000000000 Z dependencies: [] description: email: [email protected] @@ -19,7 +19,7 @@ - lib/xmlsimple.rb homepage: https://github.com/maik/xml-simple licenses: -- Ruby +- MIT metadata: {} post_install_message: rdoc_options: [] @@ -36,8 +36,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubyforge_project: xml-simple -rubygems_version: 2.4.6 +rubygems_version: 3.1.2 signing_key: specification_version: 4 summary: A simple API for XML processing.
