parallel 0.5.15 → 0.5.16

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source :rubygems
2
+ gemspec
2
3
 
3
- group :dev do
4
+ group :development do
4
5
  gem 'rake'
5
6
  gem 'rspec', '~>2'
6
- gem 'jeweler'
7
7
  end
data/Gemfile.lock CHANGED
@@ -1,14 +1,12 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ parallel (0.5.16)
5
+
1
6
  GEM
2
7
  remote: http://rubygems.org/
3
8
  specs:
4
9
  diff-lcs (1.1.2)
5
- gemcutter (0.6.1)
6
- git (1.2.5)
7
- jeweler (1.4.0)
8
- gemcutter (>= 0.1.0)
9
- git (>= 1.2.5)
10
- rubyforge (>= 2.0.0)
11
- json_pure (1.4.6)
12
10
  rake (0.8.7)
13
11
  rspec (2.6.0)
14
12
  rspec-core (~> 2.6.0)
@@ -18,13 +16,11 @@ GEM
18
16
  rspec-expectations (2.6.0)
19
17
  diff-lcs (~> 1.1.2)
20
18
  rspec-mocks (2.6.0)
21
- rubyforge (2.0.4)
22
- json_pure (>= 1.1.7)
23
19
 
24
20
  PLATFORMS
25
21
  ruby
26
22
 
27
23
  DEPENDENCIES
28
- jeweler
24
+ parallel!
29
25
  rake
30
26
  rspec (~> 2)
data/Rakefile CHANGED
@@ -1,21 +1,23 @@
1
- task :default => :spec
2
- require "rspec/core/rake_task"
3
- RSpec::Core::RakeTask.new(:spec) do |t|
4
- t.rspec_opts = '--backtrace --color'
1
+ require 'bundler/gem_tasks'
2
+
3
+ task :default do
4
+ sh "rspec spec/"
5
5
  end
6
6
 
7
- begin
8
- require 'jeweler'
9
- Jeweler::Tasks.new do |gem|
10
- gem.name = 'parallel'
11
- gem.summary = "Run any kind of code in parallel processes"
12
- gem.email = "grosser.michael@gmail.com"
13
- gem.homepage = "http://github.com/grosser/#{gem.name}"
14
- gem.authors = ["Michael Grosser"]
15
- gem.license = "MIT"
16
- end
7
+ # extracted from https://github.com/grosser/project_template
8
+ rule /^version:bump:.*/ do |t|
9
+ sh "git status | grep 'nothing to commit'" # ensure we are not dirty
10
+ index = ['major', 'minor','patch'].index(t.name.split(':').last)
11
+ file = 'lib/parallel/version.rb'
12
+
13
+ version_file = File.read(file)
14
+ old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
15
+ version_parts[index] = version_parts[index].to_i + 1
16
+ version_parts[2] = 0 if index < 2 # remove patch for minor
17
+ version_parts[1] = 0 if index < 1 # remove minor for major
18
+ new_version = version_parts * '.'
19
+ File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
17
20
 
18
- Jeweler::GemcutterTasks.new
19
- rescue LoadError
20
- puts "Jeweler, or one of its dependencies, is not available. Install it with: gem install jeweler"
21
+ sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
21
22
  end
23
+
data/lib/parallel.rb CHANGED
@@ -1,9 +1,8 @@
1
1
  require 'thread' # to get Thread.exclusive
2
2
  require 'rbconfig'
3
+ require 'parallel/version'
3
4
 
4
- class Parallel
5
- VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
6
-
5
+ module Parallel
7
6
  def self.in_threads(options={:count => 2})
8
7
  count, options = extract_count_from_options(options)
9
8
 
@@ -0,0 +1,3 @@
1
+ module Parallel
2
+ VERSION = Version = '0.5.16'
3
+ end
data/parallel.gemspec CHANGED
@@ -1,95 +1,12 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
1
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
2
+ name = "parallel"
3
+ require "#{name}/version"
5
4
 
6
- Gem::Specification.new do |s|
7
- s.name = "parallel"
8
- s.version = "0.5.15"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Michael Grosser"]
12
- s.date = "2012-02-24"
13
- s.email = "grosser.michael@gmail.com"
14
- s.files = [
15
- "Gemfile",
16
- "Gemfile.lock",
17
- "Rakefile",
18
- "Readme.md",
19
- "VERSION",
20
- "lib/parallel.rb",
21
- "parallel.gemspec",
22
- "spec/cases/closes_processes_at_runtime.rb",
23
- "spec/cases/count_open_pipes.rb",
24
- "spec/cases/each.rb",
25
- "spec/cases/each_with_index.rb",
26
- "spec/cases/host_os_override_processor_count.rb",
27
- "spec/cases/map_with_index.rb",
28
- "spec/cases/map_with_index_empty.rb",
29
- "spec/cases/map_with_nested_arrays_and_nil.rb",
30
- "spec/cases/map_with_processes_and_exceptions.rb",
31
- "spec/cases/map_with_threads_and_exceptions.rb",
32
- "spec/cases/no_dump_with_each.rb",
33
- "spec/cases/parallel_high_fork_rate.rb",
34
- "spec/cases/parallel_influence_outside_data.rb",
35
- "spec/cases/parallel_map.rb",
36
- "spec/cases/parallel_map_complex_objects.rb",
37
- "spec/cases/parallel_map_range.rb",
38
- "spec/cases/parallel_map_sleeping.rb",
39
- "spec/cases/parallel_map_uneven.rb",
40
- "spec/cases/parallel_raise.rb",
41
- "spec/cases/parallel_raise_undumpable.rb",
42
- "spec/cases/parallel_sleeping_2.rb",
43
- "spec/cases/parallel_start_and_kill.rb",
44
- "spec/cases/parallel_with_detected_cpus.rb",
45
- "spec/cases/parallel_with_nil_uses_detected_cpus.rb",
46
- "spec/cases/parallel_with_set_processes.rb",
47
- "spec/parallel_spec.rb",
48
- "spec/spec_helper.rb"
49
- ]
50
- s.homepage = "http://github.com/grosser/parallel"
51
- s.licenses = ["MIT"]
52
- s.rdoc_options = ["--charset=UTF-8"]
53
- s.require_paths = ["lib"]
54
- s.rubygems_version = "1.8.15"
5
+ Gem::Specification.new name, Parallel::VERSION do |s|
55
6
  s.summary = "Run any kind of code in parallel processes"
56
- s.test_files = [
57
- "spec/cases/host_os_override_processor_count.rb",
58
- "spec/cases/parallel_raise_undumpable.rb",
59
- "spec/cases/parallel_map_complex_objects.rb",
60
- "spec/cases/parallel_influence_outside_data.rb",
61
- "spec/cases/parallel_start_and_kill.rb",
62
- "spec/cases/map_with_index.rb",
63
- "spec/cases/each.rb",
64
- "spec/cases/map_with_nested_arrays_and_nil.rb",
65
- "spec/cases/map_with_processes_and_exceptions.rb",
66
- "spec/cases/parallel_map_sleeping.rb",
67
- "spec/cases/parallel_raise.rb",
68
- "spec/cases/parallel_map_range.rb",
69
- "spec/cases/each_with_index.rb",
70
- "spec/cases/map_with_threads_and_exceptions.rb",
71
- "spec/cases/parallel_sleeping_2.rb",
72
- "spec/cases/parallel_map_uneven.rb",
73
- "spec/cases/parallel_high_fork_rate.rb",
74
- "spec/cases/parallel_with_set_processes.rb",
75
- "spec/cases/closes_processes_at_runtime.rb",
76
- "spec/cases/parallel_with_detected_cpus.rb",
77
- "spec/cases/map_with_index_empty.rb",
78
- "spec/cases/parallel_with_nil_uses_detected_cpus.rb",
79
- "spec/cases/parallel_map.rb",
80
- "spec/cases/no_dump_with_each.rb",
81
- "spec/cases/count_open_pipes.rb",
82
- "spec/parallel_spec.rb",
83
- "spec/spec_helper.rb"
84
- ]
85
-
86
- if s.respond_to? :specification_version then
87
- s.specification_version = 3
88
-
89
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
90
- else
91
- end
92
- else
93
- end
7
+ s.authors = ["Michael Grosser"]
8
+ s.email = "michael@grosser.it"
9
+ s.homepage = "http://github.com/grosser/#{name}"
10
+ s.files = `git ls-files`.split("\n")
11
+ s.license = "MIT"
94
12
  end
95
-
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: 21
4
+ hash: 43
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 15
10
- version: 0.5.15
9
+ - 16
10
+ version: 0.5.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser
@@ -15,11 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-24 00:00:00 Z
18
+ date: 2012-03-06 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description:
22
- email: grosser.michael@gmail.com
22
+ email: michael@grosser.it
23
23
  executables: []
24
24
 
25
25
  extensions: []
@@ -31,8 +31,8 @@ files:
31
31
  - Gemfile.lock
32
32
  - Rakefile
33
33
  - Readme.md
34
- - VERSION
35
34
  - lib/parallel.rb
35
+ - lib/parallel/version.rb
36
36
  - parallel.gemspec
37
37
  - spec/cases/closes_processes_at_runtime.rb
38
38
  - spec/cases/count_open_pipes.rb
@@ -65,8 +65,8 @@ homepage: http://github.com/grosser/parallel
65
65
  licenses:
66
66
  - MIT
67
67
  post_install_message:
68
- rdoc_options:
69
- - --charset=UTF-8
68
+ rdoc_options: []
69
+
70
70
  require_paths:
71
71
  - lib
72
72
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -94,31 +94,5 @@ rubygems_version: 1.8.15
94
94
  signing_key:
95
95
  specification_version: 3
96
96
  summary: Run any kind of code in parallel processes
97
- test_files:
98
- - spec/cases/host_os_override_processor_count.rb
99
- - spec/cases/parallel_raise_undumpable.rb
100
- - spec/cases/parallel_map_complex_objects.rb
101
- - spec/cases/parallel_influence_outside_data.rb
102
- - spec/cases/parallel_start_and_kill.rb
103
- - spec/cases/map_with_index.rb
104
- - spec/cases/each.rb
105
- - spec/cases/map_with_nested_arrays_and_nil.rb
106
- - spec/cases/map_with_processes_and_exceptions.rb
107
- - spec/cases/parallel_map_sleeping.rb
108
- - spec/cases/parallel_raise.rb
109
- - spec/cases/parallel_map_range.rb
110
- - spec/cases/each_with_index.rb
111
- - spec/cases/map_with_threads_and_exceptions.rb
112
- - spec/cases/parallel_sleeping_2.rb
113
- - spec/cases/parallel_map_uneven.rb
114
- - spec/cases/parallel_high_fork_rate.rb
115
- - spec/cases/parallel_with_set_processes.rb
116
- - spec/cases/closes_processes_at_runtime.rb
117
- - spec/cases/parallel_with_detected_cpus.rb
118
- - spec/cases/map_with_index_empty.rb
119
- - spec/cases/parallel_with_nil_uses_detected_cpus.rb
120
- - spec/cases/parallel_map.rb
121
- - spec/cases/no_dump_with_each.rb
122
- - spec/cases/count_open_pipes.rb
123
- - spec/parallel_spec.rb
124
- - spec/spec_helper.rb
97
+ test_files: []
98
+
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.5.15