enparallel-bin 1.0.4 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/enparallel +5 -5
- data/lib/enparallel/cli.rb +13 -5
- data/lib/enparallel/version.rb +1 -1
- data/lib/enparallel.rb +6 -0
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86265b09bdd23652b3d3039c6f05a6a4f7e2704cf6d4a72e139c2d8b01d2d20a
|
4
|
+
data.tar.gz: eb64cbe3f9f310e852ac380e8780b1851d89e36b918ec91d7f5cf52a70c3ce91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81c85e040d396ddab4669c8a4d041e6251931998c5b99d46a030cd1a714613adb384a0135497bd9183584cdb395754f1817737bc7ee71bcde1a1ca5c154e430f
|
7
|
+
data.tar.gz: d30ef78977c32c99d89ff1cf70101177ff2452c46192ff8b5261e4426f76774e6d250c2b11f234f07544809a3eb301747e3551b009c96a676dc35fa8a3698584
|
data/bin/enparallel
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
2
|
require_relative '../lib/enparallel'
|
4
3
|
include Enparallel
|
5
4
|
|
6
5
|
class Main
|
7
|
-
def self.run
|
6
|
+
def self.run
|
7
|
+
cli = CLI.parse(ARGV, STDIN)
|
8
8
|
tasks = cli.inputs.map { |input| Task.new(cli.command, input) }
|
9
9
|
pool = ThreadPool.new(tasks, cli.workers, cli.pick)
|
10
10
|
new(pool).run
|
@@ -89,8 +89,8 @@ class Main
|
|
89
89
|
end
|
90
90
|
|
91
91
|
begin
|
92
|
-
Main.run
|
92
|
+
Main.run
|
93
93
|
rescue Docopt::Exit => e
|
94
|
-
puts
|
95
|
-
exit
|
94
|
+
puts CLI.usage
|
95
|
+
exit 1
|
96
96
|
end
|
data/lib/enparallel/cli.rb
CHANGED
@@ -14,7 +14,14 @@ module Enparallel
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.parse(argv, stdin)
|
17
|
-
|
17
|
+
opts = Docopt::docopt(usage, argv: argv)
|
18
|
+
|
19
|
+
if opts['--version']
|
20
|
+
puts VERSION
|
21
|
+
exit
|
22
|
+
end
|
23
|
+
|
24
|
+
new(opts, stdin)
|
18
25
|
end
|
19
26
|
|
20
27
|
def self.basename
|
@@ -23,10 +30,11 @@ module Enparallel
|
|
23
30
|
|
24
31
|
def self.usage
|
25
32
|
<<~EOF
|
26
|
-
|
33
|
+
Usage:
|
27
34
|
#{basename} [options] [--] <command>...
|
35
|
+
#{basename} ( --version | --help )
|
28
36
|
|
29
|
-
|
37
|
+
Description:
|
30
38
|
#{basename} operates by reading lines from standard input, and executing
|
31
39
|
<command> once per entry, in parallel.
|
32
40
|
|
@@ -41,13 +49,13 @@ module Enparallel
|
|
41
49
|
|
42
50
|
seq 1 10 | enparallel -- bash -c "sleep {} && echo Slept for {}"
|
43
51
|
|
44
|
-
|
52
|
+
Options:
|
45
53
|
-w, --workers <n> Batch into a pool of <n> workers [default: #{workers_default}].
|
46
54
|
-p, --pick <type> Task-picking rule (see "Types") [default: #{pick_default}].
|
47
55
|
-v, --version Version.
|
48
56
|
-h, --help Help.
|
49
57
|
|
50
|
-
|
58
|
+
Types:
|
51
59
|
sequential The order in which the tasks were queued.
|
52
60
|
random Random order.
|
53
61
|
EOF
|
data/lib/enparallel/version.rb
CHANGED
data/lib/enparallel.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enparallel-bin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- crdx
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: require_all
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: colorize
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.21.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.21.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,16 +100,16 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '13.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
111
|
-
description:
|
112
|
-
email:
|
110
|
+
version: '13.0'
|
111
|
+
description:
|
112
|
+
email:
|
113
113
|
executables:
|
114
114
|
- enparallel
|
115
115
|
extensions: []
|
@@ -130,7 +130,7 @@ homepage: https://github.com/crdx/enparallel
|
|
130
130
|
licenses:
|
131
131
|
- MIT
|
132
132
|
metadata: {}
|
133
|
-
post_install_message:
|
133
|
+
post_install_message:
|
134
134
|
rdoc_options: []
|
135
135
|
require_paths:
|
136
136
|
- lib
|
@@ -145,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
149
|
-
signing_key:
|
148
|
+
rubygems_version: 3.2.21
|
149
|
+
signing_key:
|
150
150
|
specification_version: 4
|
151
|
-
summary:
|
151
|
+
summary: Parallel command runner with a colourful overview
|
152
152
|
test_files: []
|