parallel_run 0.2 → 0.3

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.markdown CHANGED
@@ -54,6 +54,7 @@ I can also use [capistrano](https://github.com/capistrano/capistrano/wiki), but
54
54
  -p, --prefix PREFIX Prefix for each line. You can use values (see below). Default value is '%v'.
55
55
  -t, --time_format TIME_FORMAT Time format to use for each line. Default value is %H:%M:%S
56
56
  --padding-size PADDING_SIZE Padding size for prefix. Default value is 20}
57
+ --workers WORKERS Number of workers (default number of value)
57
58
  -h, --help Display this screen
58
59
  Values can be used directly in command or prefix directly by using %v.
59
60
  You can apply some function in values before using it :
data/lib/parallel_run.rb CHANGED
@@ -40,6 +40,10 @@ optparse = OptionParser.new do|opts|
40
40
  $options[:shell] = c
41
41
  end
42
42
 
43
+ opts.on('--workers WORKERS', Integer, "Number of workers (default number of value)") do |c|
44
+ $options[:workers] = c
45
+ end
46
+
43
47
  opts.on('-h', '--help', 'Display this screen' ) do
44
48
  puts opts
45
49
  puts "Values can be used directly in command or prefix directly by using %v."
@@ -73,7 +77,7 @@ def replace s, value, k
73
77
  end
74
78
 
75
79
  result = {}
76
- ARGV.each_with_index.to_a.peach do |f, index|
80
+ ARGV.each_with_index.to_a.peach($options[:workers]) do |f, index|
77
81
  c = replace $options[:command], f, index
78
82
  prefix = replace $options[:prefix], f, index
79
83
  output("Lauching command for #{f} : #{c}", prefix) if $options[:verbose]
data/parallel_run.gemspec CHANGED
@@ -4,7 +4,7 @@ $:.push File.expand_path("../lib", __FILE__)
4
4
  Gem::Specification.new do |s|
5
5
 
6
6
  s.name = "parallel_run"
7
- s.version = "0.2"
7
+ s.version = "0.3"
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Bertrand Paquet"]
10
10
  s.email = ["bertrand.paquet@gmail.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_run
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-21 00:00:00.000000000 Z
12
+ date: 2013-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: popen4
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 1.8.24
83
+ rubygems_version: 1.8.23
84
84
  signing_key:
85
85
  specification_version: 3
86
86
  summary: Launch shell commands in parallel, capturing stdout and stderr