parallel 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ebdef905e948776369686271708c85a60b4c63c
4
- data.tar.gz: da64471e0d337ca3a778670efed6e0c2eda454af
3
+ metadata.gz: 4485e35ba1d52d6b8267884c3371533ca3e76fdc
4
+ data.tar.gz: b6e4de966f97b0c09cbb8c561efc275de370bed2
5
5
  SHA512:
6
- metadata.gz: 9677d167fc5b5796630d9654bc5dd82b1e950aa0a69537dcdb1332326ac95399d91638827cb69a00be79123db43514586d30037a92a9572dba84ff63745b4ff1
7
- data.tar.gz: 4dca43cfa0a92caf06ca45b95de2a3b28e781b6e0300b94c14fb4703a1f4a264d73c10c2d11b2e92c344e92c998afeb60245bd1aafb100c3e7d262ca88fd665f
6
+ metadata.gz: e024ac38c60e101d73719bb368ef6ec482f7fac471dc2a72dfe0b760ec12e29f75864bd35d1e483ca478fe0e2a594e0cd021d046bf048aaea602ac334aaa9e59
7
+ data.tar.gz: fd4fa3446693012160debe76cc48a1abd0c1d80632b94cf2189b375e2202e8c5fec2af8dd4e689414b3fb399b25379edc8f890b2d472a4edfb5e6866a1b7f07f
@@ -125,23 +125,26 @@ module Parallel
125
125
  # kill all these pids or threads if user presses Ctrl+c
126
126
  def kill_on_ctrl_c(things, options)
127
127
  return yield if RUBY_ENGINE == "jruby"
128
- @to_be_killed ||= []
129
- old_interrupt = nil
130
- signal = options.fetch(:interrupt_signal, INTERRUPT_SIGNAL)
131
-
132
- if @to_be_killed.empty?
133
- old_interrupt = trap_interrupt(signal) do
134
- $stderr.puts 'Parallel execution interrupted, exiting ...'
135
- @to_be_killed.flatten.compact.each { |thing| kill(thing) }
128
+
129
+ begin
130
+ @to_be_killed ||= []
131
+ old_interrupt = nil
132
+ signal = options.fetch(:interrupt_signal, INTERRUPT_SIGNAL)
133
+
134
+ if @to_be_killed.empty?
135
+ old_interrupt = trap_interrupt(signal) do
136
+ $stderr.puts 'Parallel execution interrupted, exiting ...'
137
+ @to_be_killed.flatten.compact.each { |thing| kill(thing) }
138
+ end
136
139
  end
137
- end
138
140
 
139
- @to_be_killed << things
141
+ @to_be_killed << things
140
142
 
141
- yield
142
- ensure
143
- @to_be_killed.pop # free threads for GC and do not kill pids that could be used for new processes
144
- restore_interrupt(old_interrupt, signal) if @to_be_killed.empty?
143
+ yield
144
+ ensure
145
+ @to_be_killed.pop # free threads for GC and do not kill pids that could be used for new processes
146
+ restore_interrupt(old_interrupt, signal) if @to_be_killed.empty?
147
+ end
145
148
  end
146
149
 
147
150
  def kill(thing)
@@ -1,3 +1,3 @@
1
1
  module Parallel
2
- VERSION = Version = '1.5.0'
2
+ VERSION = Version = '1.5.1'
3
3
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2015-05-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description:
13
+ description:
14
14
  email: michael@grosser.it
15
15
  executables: []
16
16
  extensions: []
@@ -24,24 +24,24 @@ homepage: https://github.com/grosser/parallel
24
24
  licenses:
25
25
  - MIT
26
26
  metadata: {}
27
- post_install_message:
27
+ post_install_message:
28
28
  rdoc_options: []
29
29
  require_paths:
30
30
  - lib
31
31
  required_ruby_version: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - '>='
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: 1.9.3
36
36
  required_rubygems_version: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  requirements: []
42
- rubyforge_project:
43
- rubygems_version: 2.1.9
44
- signing_key:
42
+ rubyforge_project:
43
+ rubygems_version: 2.2.2
44
+ signing_key:
45
45
  specification_version: 4
46
46
  summary: Run any kind of code in parallel processes
47
47
  test_files: []