parallel 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.6
1
+ 0.3.7
data/lib/parallel.rb CHANGED
@@ -17,7 +17,9 @@ class Parallel
17
17
  out
18
18
  end
19
19
 
20
- def self.in_processes(count = processor_count)
20
+ def self.in_processes(count = nil)
21
+ count ||= processor_count
22
+
21
23
  # Start writing results into n pipes
22
24
  reads = []
23
25
  writes = []
data/parallel.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{parallel}
8
- s.version = "0.3.6"
8
+ s.version = "0.3.7"
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 = %q{2009-11-22}
12
+ s.date = %q{2009-12-19}
13
13
  s.email = %q{grosser.michael@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README.markdown"
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
31
31
  "spec/cases/parallel_sleeping_2.rb",
32
32
  "spec/cases/parallel_start_and_kill.rb",
33
33
  "spec/cases/parallel_with_detected_cpus.rb",
34
+ "spec/cases/parallel_with_nil_uses_detected_cpus.rb",
34
35
  "spec/cases/parallel_with_set_processes.rb",
35
36
  "spec/parallel_spec.rb",
36
37
  "spec/spec_helper.rb"
@@ -42,6 +43,7 @@ Gem::Specification.new do |s|
42
43
  s.summary = %q{Run any kind of code in parallel processes}
43
44
  s.test_files = [
44
45
  "spec/spec_helper.rb",
46
+ "spec/cases/parallel_with_nil_uses_detected_cpus.rb",
45
47
  "spec/cases/parallel_map_uneven.rb",
46
48
  "spec/cases/parallel_map_range.rb",
47
49
  "spec/cases/parallel_with_set_processes.rb",
@@ -0,0 +1,6 @@
1
+ require 'spec/spec_helper.rb'
2
+
3
+ x = Parallel.in_processes(nil) do
4
+ "HELLO"
5
+ end
6
+ puts x
@@ -10,6 +10,10 @@ describe Parallel do
10
10
  `ruby spec/cases/parallel_with_detected_cpus.rb`.should == "HELLO\n" * @cpus
11
11
  end
12
12
 
13
+ it "executes with detected cpus when nil was given" do
14
+ `ruby spec/cases/parallel_with_nil_uses_detected_cpus.rb`.should == "HELLO\n" * @cpus
15
+ end
16
+
13
17
  it "set ammount of parallel processes" do
14
18
  `ruby spec/cases/parallel_with_set_processes.rb`.should == "HELLO\n" * 5
15
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-22 00:00:00 +01:00
12
+ date: 2009-12-19 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -38,6 +38,7 @@ files:
38
38
  - spec/cases/parallel_sleeping_2.rb
39
39
  - spec/cases/parallel_start_and_kill.rb
40
40
  - spec/cases/parallel_with_detected_cpus.rb
41
+ - spec/cases/parallel_with_nil_uses_detected_cpus.rb
41
42
  - spec/cases/parallel_with_set_processes.rb
42
43
  - spec/parallel_spec.rb
43
44
  - spec/spec_helper.rb
@@ -71,6 +72,7 @@ specification_version: 3
71
72
  summary: Run any kind of code in parallel processes
72
73
  test_files:
73
74
  - spec/spec_helper.rb
75
+ - spec/cases/parallel_with_nil_uses_detected_cpus.rb
74
76
  - spec/cases/parallel_map_uneven.rb
75
77
  - spec/cases/parallel_map_range.rb
76
78
  - spec/cases/parallel_with_set_processes.rb