Hello community,

here is the log from the commit of package rubygem-sexp_processor for 
openSUSE:Factory checked in at 2016-03-07 13:27:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-sexp_processor (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-sexp_processor.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-sexp_processor"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-sexp_processor/rubygem-sexp_processor.changes
    2016-03-01 09:40:50.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-sexp_processor.new/rubygem-sexp_processor.changes
       2016-03-07 13:27:53.000000000 +0100
@@ -1,0 +2,13 @@
+Fri Feb 19 05:40:04 UTC 2016 - [email protected]
+
+- updated to version 4.7.0
+ see installed History.txt
+
+  === 4.7.0 / 2016-02-18
+  
+  * 2 minor enhancements:
+  
+    * Expand to support 2.3 in tests. (presidentbeef)
+    * Return enumerable for deep_each, each_sexp, and each_of_type. 
(ridiculous)
+
+-------------------------------------------------------------------

Old:
----
  sexp_processor-4.6.1.gem

New:
----
  sexp_processor-4.7.0.gem

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

Other differences:
------------------
++++++ rubygem-sexp_processor.spec ++++++
--- /var/tmp/diff_new_pack.STUXqg/_old  2016-03-07 13:27:54.000000000 +0100
+++ /var/tmp/diff_new_pack.STUXqg/_new  2016-03-07 13:27:54.000000000 +0100
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-sexp_processor
-Version:        4.6.1
+Version:        4.7.0
 Release:        0
 %define mod_name sexp_processor
 %define mod_full_name %{mod_name}-%{version}

++++++ sexp_processor-4.6.1.gem -> sexp_processor-4.7.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/History.txt new/History.txt
--- old/History.txt     2016-01-22 00:40:32.000000000 +0100
+++ new/History.txt     2016-02-19 03:08:50.000000000 +0100
@@ -1,3 +1,10 @@
+=== 4.7.0 / 2016-02-18
+
+* 2 minor enhancements:
+
+  * Expand to support 2.3 in tests. (presidentbeef)
+  * Return enumerable for deep_each, each_sexp, and each_of_type. (ridiculous)
+
 === 4.6.1 / 2016-01-21
 
 * 1 bug fix:
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
Files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ
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      2016-01-22 00:40:32.000000000 +0100
+++ new/lib/pt_testcase.rb      2016-02-19 03:08:50.000000000 +0100
@@ -76,7 +76,7 @@
   end
 
   def self.add_19tests name, hash
-    add_tests "#{name}__19_20_21_22", hash # HACK?
+    add_tests "#{name}__19_20_21_22_23", hash # HACK?
   end
 
   def self.add_19edgecases ruby, sexp, cases
@@ -101,7 +101,7 @@
     testcases[verbose][klass] = testcases[nonverbose][klass]
   end
 
-  VER_RE = "(1[89]|2[012])"
+  VER_RE = "(1[89]|2[0123])"
 
   def self.generate_test klass, node, data, input_name, output_name
     klass.send :define_method, "test_#{node}" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/sexp.rb new/lib/sexp.rb
--- old/lib/sexp.rb     2016-01-22 00:40:32.000000000 +0100
+++ new/lib/sexp.rb     2016-02-19 03:08:50.000000000 +0100
@@ -85,9 +85,10 @@
 
   ##
   # Recursively enumerates the sexp yielding to +block+ for every element.
-  # TODO: test
 
   def deep_each(&block)
+    return enum_for(:deep_each) unless block_given?
+
     self.each_sexp do |sexp|
       block[sexp]
       sexp.deep_each(&block)
@@ -98,6 +99,8 @@
   # 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?
+
     each do | elem |
       if Sexp === elem then
         elem.each_of_type(t, &b)
@@ -108,9 +111,10 @@
 
   ##
   # Recursively enumerates all sub-sexps skipping non-Sexp elements.
-  # TODO: test
 
   def each_sexp
+    return enum_for(:each_sexp) unless block_given?
+
     self.each do |sexp|
       next unless Sexp === sexp
 
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   2016-01-22 00:40:32.000000000 +0100
+++ new/lib/sexp_processor.rb   2016-02-19 03:08:50.000000000 +0100
@@ -33,7 +33,7 @@
 
 class SexpProcessor
 
-  VERSION = "4.6.1"
+  VERSION = "4.7.0"
 
   ##
   # Automatically shifts off the Sexp type before handing the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2016-01-22 00:40:32.000000000 +0100
+++ new/metadata        2016-02-19 03:08:50.000000000 +0100
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: sexp_processor
 version: !ruby/object:Gem::Version
-  version: 4.6.1
+  version: 4.7.0
 platform: ruby
 authors:
 - Ryan Davis
@@ -29,7 +29,7 @@
   qx3h45R1CAsObX0SQDIT+rRbQrtKz1GHIZTOFYvEJjUY1XmRTZupD3CJ8Q7sDqSy
   NLq5jm1fq6Y9Uolu3RJbmycf
   -----END CERTIFICATE-----
-date: 2016-01-21 00:00:00.000000000 Z
+date: 2016-02-19 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: minitest
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       2016-01-22 00:40:32.000000000 +0100
+++ new/test/test_sexp.rb       2016-02-19 03:08:50.000000000 +0100
@@ -49,6 +49,7 @@
     @processor = SexpProcessor.new
     @sexp = @sexp_class.new(1, 2, 3)
     @basic_sexp = s(:lasgn, :var, s(:lit, 42))
+    @complex_sexp = s(:block, s(:lasgn, :foo, s(:str, "foo")), s(:if, s(:and, 
s(:true), s(:lit, 1)), s(:if, s(:lvar, :foo), s(:str, "bar"), nil), s(:true)))
     @re = s(:lit, 42)
     @bad1 = s(:lit, 24)
     @bad1 = s(:blah, 42)
@@ -310,6 +311,28 @@
   def test_to_s
     test_inspect
   end
+
+  def test_each_sexp
+    result = []
+    @basic_sexp.each_sexp { |_, val| result << val }
+    assert_equal [42], result
+  end
+
+  def test_each_sexp_without_block
+    assert_kind_of Enumerator, @basic_sexp.each_sexp
+    assert_equal [42], @basic_sexp.each_sexp.map { |_, n| n }
+  end
+
+  def test_deep_each
+    result = []
+    @complex_sexp.deep_each { |s| result << s if s.first == :if }
+    assert_equal [:if, :if], result.map { |k, _| k }
+  end
+
+  def test_deep_each_without_block
+    assert_kind_of Enumerator, @complex_sexp.deep_each
+    assert_equal [:if, :if], @complex_sexp.deep_each.select { |s, _| s == :if 
}.map { |k, _| k }
+  end
 end
 
 class TestSexpAny < SexpTestCase


Reply via email to