parallel 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md CHANGED
@@ -49,6 +49,7 @@ Authors
49
49
  - [TJ Holowaychuk](http://vision-media.ca/)
50
50
  - [Masatomo Nakano](http://twitter.com/masatomo2)
51
51
  - [Fred Wu](http://fredwu.me)
52
+ - [mikezter](http://github.com/mikezter)
52
53
 
53
54
  [Michael Grosser](http://pragmatig.wordpress.com)
54
55
  grosser.michael@gmail.com
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.4
1
+ 0.4.5
data/lib/parallel.rb CHANGED
@@ -79,7 +79,7 @@ class Parallel
79
79
  def self.processor_count
80
80
  case RUBY_PLATFORM
81
81
  when /darwin/
82
- `hwprefs cpu_count`.to_i
82
+ `hwprefs thread_count`.to_i
83
83
  when /linux/
84
84
  `cat /proc/cpuinfo | grep processor | wc -l`.to_i
85
85
  when /freebsd/
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.4.4"
8
+ s.version = "0.4.5"
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{2010-09-24}
12
+ s.date = %q{2010-10-06}
13
13
  s.email = %q{grosser.michael@gmail.com}
14
14
  s.files = [
15
15
  "Rakefile",
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
22
22
  "spec/cases/each_with_index.rb",
23
23
  "spec/cases/map_with_index.rb",
24
24
  "spec/cases/map_with_index_empty.rb",
25
+ "spec/cases/map_with_nested_arrays_and_nil.rb",
25
26
  "spec/cases/no_dump_with_each.rb",
26
27
  "spec/cases/parallel_high_fork_rate.rb",
27
28
  "spec/cases/parallel_influence_outside_data.rb",
@@ -59,6 +60,7 @@ Gem::Specification.new do |s|
59
60
  "spec/cases/cloeses_processes_at_runtime.rb",
60
61
  "spec/cases/parallel_with_detected_cpus.rb",
61
62
  "spec/cases/each.rb",
63
+ "spec/cases/map_with_nested_arrays_and_nil.rb",
62
64
  "spec/cases/map_with_index_empty.rb",
63
65
  "spec/cases/parallel_raise.rb",
64
66
  "spec/cases/each_with_index.rb",
@@ -0,0 +1,7 @@
1
+ require File.expand_path('spec/spec_helper')
2
+
3
+ result = Parallel.map([1,2,[3]]) do |x|
4
+ [x, x] if x != 1
5
+ end
6
+
7
+ print result.inspect
@@ -105,6 +105,10 @@ describe Parallel do
105
105
  it 'supports ranges' do
106
106
  `ruby spec/cases/parallel_map_range.rb`.should == '[1, 2, 3, 4, 5]'
107
107
  end
108
+
109
+ it 'handles nested arrays and nil correctly' do
110
+ `ruby spec/cases/map_with_nested_arrays_and_nil.rb`.should == '[nil, [2, 2], [[3], [3]]]'
111
+ end
108
112
  end
109
113
 
110
114
  describe :map_with_index do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 4
9
- version: 0.4.4
8
+ - 5
9
+ version: 0.4.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Grosser
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-24 00:00:00 +02:00
17
+ date: 2010-10-06 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -37,6 +37,7 @@ files:
37
37
  - spec/cases/each_with_index.rb
38
38
  - spec/cases/map_with_index.rb
39
39
  - spec/cases/map_with_index_empty.rb
40
+ - spec/cases/map_with_nested_arrays_and_nil.rb
40
41
  - spec/cases/no_dump_with_each.rb
41
42
  - spec/cases/parallel_high_fork_rate.rb
42
43
  - spec/cases/parallel_influence_outside_data.rb
@@ -98,6 +99,7 @@ test_files:
98
99
  - spec/cases/cloeses_processes_at_runtime.rb
99
100
  - spec/cases/parallel_with_detected_cpus.rb
100
101
  - spec/cases/each.rb
102
+ - spec/cases/map_with_nested_arrays_and_nil.rb
101
103
  - spec/cases/map_with_index_empty.rb
102
104
  - spec/cases/parallel_raise.rb
103
105
  - spec/cases/each_with_index.rb