Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-sexp_processor for 
openSUSE:Factory checked in at 2022-02-07 23:37:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-sexp_processor (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-sexp_processor.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-sexp_processor"

Mon Feb  7 23:37:41 2022 rev:36 rq:949078 version:4.16.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-sexp_processor/rubygem-sexp_processor.changes
    2021-07-02 13:28:51.520112753 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-sexp_processor.new.1898/rubygem-sexp_processor.changes
  2022-02-07 23:38:42.502190743 +0100
@@ -1,0 +2,22 @@
+Tue Jan 25 07:35:50 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 4.16.0
+ see installed History.rdoc
+
+  === 4.16.0 / 2021-10-27
+  
+  * 4 minor enhancements:
+  
+    * Added Sexp#value (pushed up from ruby_parser).
+    * Aliased Sexp#concat to #_concat and use that so it can be overridden.
+    * Cache the #hash result.
+    * StrictSexp mode (4) now covers concat.
+  
+  * 3 bug fixes:
+  
+    * Fix some doco on each_sexp to clarify that it is not recursive.
+    * Fixed a bug calling enum_for when using each_of_type w/ no block.
+    * Minor fixes to pt_testcase.rb for custom timeouts and better error 
handling.
+  
+
+-------------------------------------------------------------------

Old:
----
  sexp_processor-4.15.3.gem

New:
----
  sexp_processor-4.16.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-sexp_processor.spec ++++++
--- /var/tmp/diff_new_pack.UFMk74/_old  2022-02-07 23:38:43.002187322 +0100
+++ /var/tmp/diff_new_pack.UFMk74/_new  2022-02-07 23:38:43.006187294 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-sexp_processor
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-sexp_processor
-Version:        4.15.3
+Version:        4.16.0
 Release:        0
 %define mod_name sexp_processor
 %define mod_full_name %{mod_name}-%{version}

++++++ sexp_processor-4.15.3.gem -> sexp_processor-4.16.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/History.rdoc new/History.rdoc
--- old/History.rdoc    2021-05-15 22:47:50.000000000 +0200
+++ new/History.rdoc    2021-10-27 09:55:32.000000000 +0200
@@ -1,3 +1,18 @@
+=== 4.16.0 / 2021-10-27
+
+* 4 minor enhancements:
+
+  * Added Sexp#value (pushed up from ruby_parser).
+  * Aliased Sexp#concat to #_concat and use that so it can be overridden.
+  * Cache the #hash result.
+  * StrictSexp mode (4) now covers concat.
+
+* 3 bug fixes:
+
+  * Fix some doco on each_sexp to clarify that it is not recursive.
+  * Fixed a bug calling enum_for when using each_of_type w/ no block.
+  * Minor fixes to pt_testcase.rb for custom timeouts and better error 
handling.
+
 === 4.15.3 / 2021-05-15
 
 * 1 minor enhancement:
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
Binary files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ
Binary files old/data.tar.gz.sig and new/data.tar.gz.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/pt_testcase.rb new/lib/pt_testcase.rb
--- old/lib/pt_testcase.rb      2021-05-15 22:47:50.000000000 +0200
+++ new/lib/pt_testcase.rb      2021-10-27 09:55:32.000000000 +0200
@@ -150,7 +150,8 @@
 
         before_process_hook klass, node, data, input_name, output_name
         refute_nil data[input_name], "testcase does not exist?"
-        @result = processor.process input
+        timeout = (ENV["RP_TIMEOUT"] || 10).to_i
+        @result = processor.process input, "(string)", timeout
         assert_equal(expected, @result,
                      "failed on input: #{data[input_name].inspect}")
         after_process_hook klass, node, data, input_name, output_name
@@ -158,7 +159,11 @@
         extra_input.each do |extra|
           processor.process(extra)
         end
-        extra = processor.extra_methods rescue []
+        extra = if processor.respond_to?(:extra_methods) then
+                  processor.extra_methods
+                else
+                  []
+                end
         assert_equal extra_expected, extra
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/sexp.rb new/lib/sexp.rb
--- old/lib/sexp.rb     2021-05-15 22:47:50.000000000 +0200
+++ new/lib/sexp.rb     2021-10-27 09:55:32.000000000 +0200
@@ -31,13 +31,15 @@
     super(args)
   end
 
+  alias _concat concat
+
   ##
   # Creates a new Sexp from Array +a+.
 
   def self.from_array a
     ary = Array === a ? a : [a]
 
-    self.new.concat(ary.map { |x|
+    self.new._concat(ary.map { |x|
                case x
                when Sexp
                  x
@@ -54,7 +56,7 @@
   # same +file+, +line+, and +comment+ as self.
 
   def new(*body)
-    r = self.class.new.concat(body) # ensures a sexp from map
+    r = self.class.new._concat(body) # ensures a sexp from map
     r.file     = self.file     if self.file
     r.line     = self.line     if self.line
     r.comments = self.comments if self.comments
@@ -62,7 +64,7 @@
   end
 
   def map &blk # :nodoc:
-    self.new.concat(super(&blk)) # ensures a sexp from map
+    self.new._concat(super(&blk)) # ensures a sexp from map
   end
 
   def == obj # :nodoc:
@@ -74,7 +76,7 @@
   end
 
   def hash
-    [self.class, *self].hash
+    @hash ||= [self.class, *self].hash
   end
 
   ##
@@ -93,7 +95,7 @@
   end
 
   ##
-  # Recursively enumerates the sexp yielding to +block+ for every element.
+  # Recursively enumerates the sexp yielding to +block+ for every sub-Sexp.
   #
   # Returning :skip will stop traversing that subtree:
   #
@@ -122,7 +124,7 @@
   # Enumeratates the sexp yielding to +b+ when the node_type == +t+.
 
   def each_of_type t, &b
-    return enum_for(:each_of_type) unless block_given?
+    return enum_for(:each_of_type, t) unless block_given?
 
     each_sexp do | sexp |
       sexp.each_of_type(t, &b)
@@ -131,7 +133,7 @@
   end
 
   ##
-  # Recursively enumerates all sub-sexps skipping non-Sexp elements.
+  # Enumerates all sub-sexps skipping non-Sexp elements.
 
   def each_sexp
     return enum_for(:each_sexp) unless block_given?
@@ -289,11 +291,11 @@
   # the values without the node type.
 
   def sexp_body from = 1
-    self.new.concat(self[from..-1] || [])
+    self.new._concat(self[from..-1] || [])
   end
 
   ##
-  # Returns the Sexp body, ie the values without the node type.
+  # Sets the Sexp body to new content.
 
   def sexp_body= v
     self[1..-1] = v
@@ -362,6 +364,14 @@
   end
 
   alias to_s inspect # :nodoc:
+
+  ##
+  # Return the value (last item) of a single element sexp (eg `s(:lit, 42)`).
+
+  def value
+    raise "multi item sexp" if size > 2
+    last
+  end
 end
 
 ##
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/sexp_processor.rb new/lib/sexp_processor.rb
--- old/lib/sexp_processor.rb   2021-05-15 22:47:50.000000000 +0200
+++ new/lib/sexp_processor.rb   2021-10-27 09:55:32.000000000 +0200
@@ -34,7 +34,7 @@
 class SexpProcessor
 
   # duh
-  VERSION = "4.15.3"
+  VERSION = "4.16.0"
 
   ##
   # Automatically shifts off the Sexp type before handing the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/strict_sexp.rb new/lib/strict_sexp.rb
--- old/lib/strict_sexp.rb      2021-05-15 22:47:50.000000000 +0200
+++ new/lib/strict_sexp.rb      2021-10-27 09:55:32.000000000 +0200
@@ -36,6 +36,7 @@
 # 4 = sexp <<         => no
 
 class Sexp
+  # alias :_concat     :concat in sexp.rb so we have access to the original
   alias :safe_idx   :[]
   alias :safe_asgn  :[]=
   alias :sexp_type= :sexp_type=
@@ -43,9 +44,10 @@
   alias :shift :shift
 
   def self.nuke_method name, level
+    return unless __strict >= level
     define_method name do |*args|
       raise "no mutation allowed on sexps: %s.%s %s" % [self, name, args]
-    end if __strict >= level
+    end
   end
 
   def self.__strict
@@ -87,7 +89,7 @@
 
   nuke_method :collect!, 4
   nuke_method :compact!, 4
-  # nuke_method :concat,   4 # HACK: using self.class.new.concat(...) for 
speed 
+  nuke_method :concat,   4 # HACK: using self.class.new.concat(...) for speed
   nuke_method :flatten!, 4
   nuke_method :map!,     4
   nuke_method :pop,      4
@@ -111,7 +113,7 @@
   end
 
   def sexp_body from = 1
-    self.new.concat(safe_idx(from..-1) || [])
+    self.new._concat(safe_idx(from..-1) || [])
   end
 
   def sexp_type= v
@@ -123,4 +125,24 @@
   end
 end unless Sexp.new.respond_to? :safe_asgn if ENV["STRICT_SEXP"]
 
+if ENV["SP_DEBUG"] && !ENV["STRICT_SEXP"] then
+  class Sexp
+    mutators = %i[
+                  []= clear collect! compact! concat delete delete_at
+                  delete_if drop drop_while fill flatten! replace insert
+                  keep_if map! pop push reject! reverse! rotate! select!
+                  shift shuffle! slice! sort! sort_by! transpose uniq!
+                  unshift
+                 ]
+
+    mutators.each do |method|
+      define_method method do |*|
+        warn "Sexp modified by %p at %s" % [__method__, caller.first] if
+          $VERBOSE or (defined?(@hash) and @hash)
+        super
+      end
+    end
+  end
+end
+
 # :startdoc:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2021-05-15 22:47:50.000000000 +0200
+++ new/metadata        2021-10-27 09:55:32.000000000 +0200
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: sexp_processor
 version: !ruby/object:Gem::Version
-  version: 4.15.3
+  version: 4.16.0
 platform: ruby
 authors:
 - Ryan Davis
@@ -29,7 +29,7 @@
   d/AHw/kcnU6iuMUoJEcGiJd4gVCTn1l3cDcIvxakGslCA88Jubw0Sqatan0TnC9g
   KToW560QIey7SPfHWduzFJnV
   -----END CERTIFICATE-----
-date: 2021-05-15 00:00:00.000000000 Z
+date: 2021-10-27 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: rdoc
Binary files old/metadata.gz.sig and new/metadata.gz.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/test_sexp.rb new/test/test_sexp.rb
--- old/test/test_sexp.rb       2021-05-15 22:47:50.000000000 +0200
+++ new/test/test_sexp.rb       2021-10-27 09:55:32.000000000 +0200
@@ -193,6 +193,12 @@
     assert_equal(3, count, "must find 3 a's in #{@sexp.inspect}")
   end
 
+  def test_each_of_type_no_block
+    @sexp = s(:a, s(:b), s(:c), :d)
+
+    assert_equal [s(:b)], @sexp.each_of_type(:b).to_a
+  end
+
   def test_equals2_array
     refute_equal @sexp, [1, 2, 3]        # Sexp == Array
     assert_raises Minitest::Assertion do # Array == Sexp.
@@ -654,6 +660,18 @@
     assert_equal DEEP_EXP, act.map { |k, _| k }
   end
 
+  def test_deep_each_sexp_recursive
+    sexp = s(:array, s(:lit, 1), nil, 42, s(:array, s(:lit, 2)))
+
+    result = []
+    sexp.deep_each { |x| result << x.last if x.sexp_type == :lit }
+    assert_equal [1, 2], result
+
+    result = []
+    sexp.each_of_type(:lit) { |x| result << x.last }
+    assert_equal [1, 2], result
+  end
+
   def test_deep_each_skip
     exp = DEEP_EXP.first(3) + DEEP_EXP.last(4)
     act = []

Reply via email to