parallel 0.5.13 → 0.5.14

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.13
1
+ 0.5.14
@@ -292,6 +292,11 @@ class Parallel
292
292
  class ExceptionWrapper
293
293
  attr_reader :exception
294
294
  def initialize(exception)
295
+ dumpable = Parallel.encode(exception) rescue nil
296
+ unless dumpable
297
+ exception = RuntimeError.new("Undumpable Exception -- #{exception.inspect}")
298
+ end
299
+
295
300
  @exception = exception
296
301
  end
297
302
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "parallel"
8
- s.version = "0.5.13"
8
+ s.version = "0.5.14"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = "2012-02-01"
12
+ s.date = "2012-02-07"
13
13
  s.email = "grosser.michael@gmail.com"
14
14
  s.files = [
15
15
  "Gemfile",
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
37
37
  "spec/cases/parallel_map_sleeping.rb",
38
38
  "spec/cases/parallel_map_uneven.rb",
39
39
  "spec/cases/parallel_raise.rb",
40
+ "spec/cases/parallel_raise_undumpable.rb",
40
41
  "spec/cases/parallel_sleeping_2.rb",
41
42
  "spec/cases/parallel_start_and_kill.rb",
42
43
  "spec/cases/parallel_with_detected_cpus.rb",
@@ -62,6 +63,7 @@ Gem::Specification.new do |s|
62
63
  "spec/cases/parallel_with_set_processes.rb",
63
64
  "spec/cases/parallel_with_detected_cpus.rb",
64
65
  "spec/cases/parallel_start_and_kill.rb",
66
+ "spec/cases/parallel_raise_undumpable.rb",
65
67
  "spec/cases/parallel_sleeping_2.rb",
66
68
  "spec/cases/host_os_override_processor_count.rb",
67
69
  "spec/cases/map_with_index.rb",
@@ -0,0 +1,17 @@
1
+ require File.expand_path('spec/spec_helper')
2
+ require 'stringio'
3
+
4
+ class MyException < Exception
5
+ def initialize(object)
6
+ @object = object
7
+ end
8
+ end
9
+
10
+ begin
11
+ Parallel.in_processes(2) do
12
+ raise MyException.new(StringIO.new)
13
+ end
14
+ puts "FAIL"
15
+ rescue RuntimeError
16
+ puts $!.message
17
+ end
@@ -20,7 +20,7 @@ describe Parallel do
20
20
  end
21
21
 
22
22
  it "defaults to 1 if we don't know better" do
23
- `ruby spec/cases/host_os_override_processor_count.rb`.to_i.should == 1
23
+ `ruby spec/cases/host_os_override_processor_count.rb 2>/dev/null`.to_i.should == 1
24
24
  end
25
25
  end
26
26
 
@@ -81,6 +81,10 @@ describe Parallel do
81
81
  `ruby spec/cases/parallel_raise.rb`.strip.should == 'TEST'
82
82
  end
83
83
 
84
+ it "can raise an undumpable exception" do
85
+ `ruby spec/cases/parallel_raise_undumpable.rb`.strip.should include('Undumpable Exception')
86
+ end
87
+
84
88
  it 'can handle to high fork rate' do
85
89
  `ruby spec/cases/parallel_high_fork_rate.rb`.should == 'OK'
86
90
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 13
10
- version: 0.5.13
9
+ - 14
10
+ version: 0.5.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-01 00:00:00 Z
18
+ date: 2012-02-07 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description:
@@ -52,6 +52,7 @@ files:
52
52
  - spec/cases/parallel_map_sleeping.rb
53
53
  - spec/cases/parallel_map_uneven.rb
54
54
  - spec/cases/parallel_raise.rb
55
+ - spec/cases/parallel_raise_undumpable.rb
55
56
  - spec/cases/parallel_sleeping_2.rb
56
57
  - spec/cases/parallel_start_and_kill.rb
57
58
  - spec/cases/parallel_with_detected_cpus.rb
@@ -103,6 +104,7 @@ test_files:
103
104
  - spec/cases/parallel_with_set_processes.rb
104
105
  - spec/cases/parallel_with_detected_cpus.rb
105
106
  - spec/cases/parallel_start_and_kill.rb
107
+ - spec/cases/parallel_raise_undumpable.rb
106
108
  - spec/cases/parallel_sleeping_2.rb
107
109
  - spec/cases/host_os_override_processor_count.rb
108
110
  - spec/cases/map_with_index.rb