parallel 0.5.8 → 0.5.9

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.
data/Readme.md CHANGED
@@ -60,6 +60,7 @@ Authors
60
60
  - [Andrew Bowerman](http://andrewbowerman.com)
61
61
  - [Byron Bowerman](http://me.bm5k.com/)
62
62
  - [Mikko Kokkonen](https://github.com/mikian)
63
+ - [brian p o'rourke](https://github.com/bpo)
63
64
 
64
65
  [Michael Grosser](http://grosser.it)<br/>
65
66
  michael@grosser.it<br/>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.8
1
+ 0.5.9
@@ -77,6 +77,9 @@ class Parallel
77
77
  wmi = WIN32OLE.connect("winmgmts://")
78
78
  cpu = wmi.ExecQuery("select NumberOfLogicalProcessors from Win32_Processor")
79
79
  cpu.to_enum.first.NumberOfLogicalProcessors
80
+ else
81
+ $stderr.puts "Unknown architecture ( #{RbConfig::CONFIG["host_os"]} ) assuming one processor."
82
+ 1
80
83
  end
81
84
  end
82
85
 
@@ -127,7 +130,7 @@ class Parallel
127
130
  pids = []
128
131
  exception = nil
129
132
 
130
- Parallel.kill_on_ctrl_c(pids)
133
+ kill_on_ctrl_c(pids)
131
134
 
132
135
  in_threads(options[:count]) do |i|
133
136
  x = i
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{parallel}
8
- s.version = "0.5.8"
8
+ s.version = "0.5.9"
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{2011-08-18}
12
+ s.date = %q{2011-09-11}
13
13
  s.email = %q{grosser.michael@gmail.com}
14
14
  s.files = [
15
15
  "Gemfile",
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
22
22
  "spec/cases/closes_processes_at_runtime.rb",
23
23
  "spec/cases/each.rb",
24
24
  "spec/cases/each_with_index.rb",
25
+ "spec/cases/host_os_override_processor_count.rb",
25
26
  "spec/cases/map_with_index.rb",
26
27
  "spec/cases/map_with_index_empty.rb",
27
28
  "spec/cases/map_with_nested_arrays_and_nil.rb",
@@ -54,6 +55,7 @@ Gem::Specification.new do |s|
54
55
  "spec/cases/parallel_influence_outside_data.rb",
55
56
  "spec/cases/no_dump_with_each.rb",
56
57
  "spec/cases/parallel_map.rb",
58
+ "spec/cases/host_os_override_processor_count.rb",
57
59
  "spec/cases/map_with_index_empty.rb",
58
60
  "spec/cases/parallel_with_nil_uses_detected_cpus.rb",
59
61
  "spec/cases/map_with_threads_and_exceptions.rb",
@@ -0,0 +1,4 @@
1
+ require File.expand_path('spec/spec_helper')
2
+
3
+ RbConfig::CONFIG["host_os"] = "flux_capacitor99.312.4"
4
+ puts Parallel.processor_count
@@ -18,6 +18,10 @@ describe Parallel do
18
18
  (1..999).should include(Parallel.processor_count)
19
19
  end
20
20
  end
21
+
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
24
+ end
21
25
  end
22
26
 
23
27
  describe :in_processes do
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: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 8
10
- version: 0.5.8
9
+ - 9
10
+ version: 0.5.9
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: 2011-08-18 00:00:00 +02:00
18
+ date: 2011-09-11 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -38,6 +38,7 @@ files:
38
38
  - spec/cases/closes_processes_at_runtime.rb
39
39
  - spec/cases/each.rb
40
40
  - spec/cases/each_with_index.rb
41
+ - spec/cases/host_os_override_processor_count.rb
41
42
  - spec/cases/map_with_index.rb
42
43
  - spec/cases/map_with_index_empty.rb
43
44
  - spec/cases/map_with_nested_arrays_and_nil.rb
@@ -98,6 +99,7 @@ test_files:
98
99
  - spec/cases/parallel_influence_outside_data.rb
99
100
  - spec/cases/no_dump_with_each.rb
100
101
  - spec/cases/parallel_map.rb
102
+ - spec/cases/host_os_override_processor_count.rb
101
103
  - spec/cases/map_with_index_empty.rb
102
104
  - spec/cases/parallel_with_nil_uses_detected_cpus.rb
103
105
  - spec/cases/map_with_threads_and_exceptions.rb