Hello community,

here is the log from the commit of package rubygem-parallel for 
openSUSE:Factory checked in at 2019-04-03 09:24:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-parallel (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-parallel.new.25356 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-parallel"

Wed Apr  3 09:24:22 2019 rev:2 rq:689701 version:1.16.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-parallel/rubygem-parallel.changes        
2018-06-19 11:51:57.604103736 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-parallel.new.25356/rubygem-parallel.changes 
    2019-04-03 09:24:30.951716347 +0200
@@ -1,0 +2,12 @@
+Fri Mar 29 06:10:13 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to version 1.16.2
+  no changelog found
+
+-------------------------------------------------------------------
+Sat Mar  2 15:29:25 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to version 1.14.0
+  no changelog found
+
+-------------------------------------------------------------------

Old:
----
  parallel-1.12.1.gem

New:
----
  parallel-1.16.2.gem

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

Other differences:
------------------
++++++ rubygem-parallel.spec ++++++
--- /var/tmp/diff_new_pack.9tKg5u/_old  2019-04-03 09:24:33.595717592 +0200
+++ /var/tmp/diff_new_pack.9tKg5u/_new  2019-04-03 09:24:33.631717609 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-parallel
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # 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,12 +24,12 @@
 #
 
 Name:           rubygem-parallel
-Version:        1.12.1
+Version:        1.16.2
 Release:        0
 %define mod_name parallel
 %define mod_full_name %{mod_name}-%{version}
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  %{ruby >= 1.9.3}
+BuildRequires:  %{ruby >= 2.2}
 BuildRequires:  %{rubygem gem2rpm}
 BuildRequires:  ruby-macros >= 5
 Url:            https://github.com/grosser/parallel

++++++ parallel-1.12.1.gem -> parallel-1.16.2.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/parallel/processor_count.rb 
new/lib/parallel/processor_count.rb
--- old/lib/parallel/processor_count.rb 2017-12-16 03:25:11.000000000 +0100
+++ new/lib/parallel/processor_count.rb 2019-03-29 04:53:54.000000000 +0100
@@ -1,60 +1,11 @@
-if RUBY_VERSION.to_f >= 2.2
-  require 'etc'
-end
+require 'etc'
 
 module Parallel
   module ProcessorCount
-    # Number of processors seen by the OS and used for process scheduling.
-    #
-    # * AIX: /usr/sbin/pmcycles (AIX 5+), /usr/sbin/lsdev
-    # * BSD: /sbin/sysctl
-    # * Cygwin: /proc/cpuinfo
-    # * Darwin: /usr/bin/hwprefs, /usr/sbin/sysctl
-    # * HP-UX: /usr/sbin/ioscan
-    # * IRIX: /usr/sbin/sysconf
-    # * Linux: /proc/cpuinfo
-    # * Minix 3+: /proc/cpuinfo
-    # * Solaris: /usr/sbin/psrinfo
-    # * Tru64 UNIX: /usr/sbin/psrinfo
-    # * UnixWare: /usr/sbin/psrinfo
-    #
+    # Number of processors seen by the OS and used for process scheduling. 
It's just wrapper for Etc.nprocessors
     def processor_count
       @processor_count ||= begin
-        if defined?(Etc) && Etc.respond_to?(:nprocessors)
-          Etc.nprocessors
-        else
-          os_name = RbConfig::CONFIG["target_os"]
-          if os_name =~ /mingw|mswin/
-            require 'win32ole'
-            result = WIN32OLE.connect("winmgmts://").ExecQuery(
-              "select NumberOfLogicalProcessors from Win32_Processor")
-            result.to_enum.collect(&:NumberOfLogicalProcessors).reduce(:+)
-          elsif File.readable?("/proc/cpuinfo")
-            IO.read("/proc/cpuinfo").scan(/^processor/).size
-          elsif File.executable?("/usr/bin/hwprefs")
-            IO.popen("/usr/bin/hwprefs thread_count").read.to_i
-          elsif File.executable?("/usr/sbin/psrinfo")
-            IO.popen("/usr/sbin/psrinfo").read.scan(/^.*on-*line/).size
-          elsif File.executable?("/usr/sbin/ioscan")
-            IO.popen("/usr/sbin/ioscan -kC processor") do |out|
-              out.read.scan(/^.*processor/).size
-            end
-          elsif File.executable?("/usr/sbin/pmcycles")
-            IO.popen("/usr/sbin/pmcycles -m").read.count("\n")
-          elsif File.executable?("/usr/sbin/lsdev")
-            IO.popen("/usr/sbin/lsdev -Cc processor -S 1").read.count("\n")
-          elsif File.executable?("/usr/sbin/sysconf") and os_name =~ /irix/i
-            IO.popen("/usr/sbin/sysconf NPROC_ONLN").read.to_i
-          elsif File.executable?("/usr/sbin/sysctl")
-            IO.popen("/usr/sbin/sysctl -n hw.ncpu").read.to_i
-          elsif File.executable?("/sbin/sysctl")
-            IO.popen("/sbin/sysctl -n hw.ncpu").read.to_i
-          else
-            $stderr.puts "Unknown platform: " + RbConfig::CONFIG["target_os"]
-            $stderr.puts "Assuming 1 processor."
-            1
-          end
-        end
+        Etc.nprocessors
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/parallel/version.rb new/lib/parallel/version.rb
--- old/lib/parallel/version.rb 2017-12-16 03:25:11.000000000 +0100
+++ new/lib/parallel/version.rb 2019-03-29 04:53:54.000000000 +0100
@@ -1,3 +1,3 @@
 module Parallel
-  VERSION = Version = '1.12.1'
+  VERSION = Version = '1.16.2'
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/parallel.rb new/lib/parallel.rb
--- old/lib/parallel.rb 2017-12-16 03:25:11.000000000 +0100
+++ new/lib/parallel.rb 2019-03-29 04:53:54.000000000 +0100
@@ -22,7 +22,7 @@
     end
   end
 
-  Stop = Object.new
+  Stop = Object.new.freeze
 
   class ExceptionWrapper
     attr_reader :exception
@@ -202,9 +202,12 @@
   class << self
     def in_threads(options={:count => 2})
       count, _ = extract_count_from_options(options)
-      Array.new(count) do |i|
+      threads = Array.new(count) do |i|
         Thread.new { yield(i) }
-      end.map!(&:value)
+      end
+      threads.map(&:value)
+    ensure
+      threads.each(&:kill)
     end
 
     def in_processes(options = {}, &block)
@@ -232,9 +235,12 @@
     end
 
     def map(source, options = {}, &block)
+      options = options.dup
       options[:mutex] = Mutex.new
 
-      if RUBY_PLATFORM =~ /java/ and not options[:in_processes]
+      if options[:in_processes] && options[:in_threads]
+        raise ArgumentError.new("Please specify only one of `in_processes` or 
`in_threads`.")
+      elsif RUBY_PLATFORM =~ /java/ and not options[:in_processes]
         method = :in_threads
         size = options[method] || processor_count
       elsif options[:in_threads]
@@ -272,10 +278,15 @@
       map(array, options.merge(:with_index => true), &block)
     end
 
+    def flat_map(*args, &block)
+      map(*args, &block).flatten(1)
+    end
+
     def worker_number
       Thread.current[:parallel_worker_number]
     end
 
+    # TODO: this does not work when doing threads in forks, so should remove 
and yield the number instead if needed
     def worker_number=(worker_num)
       Thread.current[:parallel_worker_number] = worker_num
     end
@@ -352,11 +363,7 @@
     end
 
     def work_in_processes(job_factory, options, &blk)
-      workers = if options[:isolation]
-        [] # we create workers per job and not beforehand
-      else
-        create_workers(job_factory, options, &blk)
-      end
+      workers = create_workers(job_factory, options, &blk)
       results = []
       results_mutex = Mutex.new # arrays are not thread-safe
       exception = nil
@@ -364,6 +371,8 @@
       UserInterruptHandler.kill_on_ctrl_c(workers.map(&:pid), options) do
         in_threads(options) do |i|
           worker = workers[i]
+          worker.thread = Thread.current
+          worked = false
 
           begin
             loop do
@@ -372,28 +381,28 @@
               break unless index
 
               if options[:isolation]
-                worker = replace_worker(job_factory, workers, i, options, blk)
+                worker = replace_worker(job_factory, workers, i, options, blk) 
if worked
+                worked = true
+                worker.thread = Thread.current
               end
 
-              worker.thread = Thread.current
-
               begin
                 result = with_instrumentation item, index, options do
                   worker.work(job_factory.pack(item, index))
                 end
                 results_mutex.synchronize { results[index] = result } # arrays 
are not threads safe on jRuby
-              rescue
-                exception = $!
+              rescue StandardError => e
+                exception = e
                 if Parallel::Kill === exception
                   (workers - [worker]).each do |w|
-                    w.thread.kill unless w.thread.nil?
+                    w.thread.kill if w.thread
                     UserInterruptHandler.kill(w.pid)
                   end
                 end
               end
             end
           ensure
-            worker.stop if worker
+            worker.stop
           end
         end
       end
@@ -405,7 +414,7 @@
       options[:mutex].synchronize do
         # old worker is no longer used ... stop it
         worker = workers[i]
-        worker.stop if worker
+        worker.stop
 
         # create a new replacement worker
         running = workers - [worker]
@@ -456,7 +465,11 @@
         rescue
           ExceptionWrapper.new($!)
         end
-        Marshal.dump(result, write)
+        begin
+          Marshal.dump(result, write)
+        rescue Errno::EPIPE
+          return # parent thread already dead
+        end
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2017-12-16 03:25:11.000000000 +0100
+++ new/metadata        2019-03-29 04:53:54.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: parallel
 version: !ruby/object:Gem::Version
-  version: 1.12.1
+  version: 1.16.2
 platform: ruby
 authors:
 - Michael Grosser
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2017-12-16 00:00:00.000000000 Z
+date: 2019-03-29 00:00:00.000000000 Z
 dependencies: []
 description: 
 email: [email protected]
@@ -32,7 +32,7 @@
   requirements:
   - - ">="
     - !ruby/object:Gem::Version
-      version: 1.9.3
+      version: '2.2'
 required_rubygems_version: !ruby/object:Gem::Requirement
   requirements:
   - - ">="
@@ -40,7 +40,7 @@
       version: '0'
 requirements: []
 rubyforge_project: 
-rubygems_version: 2.5.1
+rubygems_version: 2.7.6
 signing_key: 
 specification_version: 4
 summary: Run any kind of code in parallel processes


Reply via email to