jobQueue 1.0.10 → 1.0.11
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.
- checksums.yaml +7 -0
- data/LICENSE +1 -1
- data/README.rdoc +6 -1
- data/bin/prun.rb +1 -1
- data/gemspec +1 -1
- data/test/test_jobqueue.rb +19 -5
- metadata +7 -9
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 28e47a4e4d54daea2eb3f428915785d36d5c984e
|
4
|
+
data.tar.gz: 0dfbb240a4e9fa889058698b651e4151c4d42e14
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a396d9cc1d450088da602edadc90b3478b91072650c0ca8a53bd7b4fc4b337c70c4ccbd0f2671818de937ac2fb6ae4b764cfa1f2e89e812e962f5e0764598811
|
7
|
+
data.tar.gz: 24d18fbab107bbb016bd25248064cd8d782bc30245acab19987fdda9d8a29c128beda96e3d92f0f11592ff744f1bb220790da739bd2a5b4f8739b5aa839c6d63
|
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -11,6 +11,10 @@ jobQueue can do the following things:
|
|
11
11
|
* Run shell commands
|
12
12
|
* Respect user definded locks
|
13
13
|
|
14
|
+
I started a python2 implementation of this, which can be installed via pip
|
15
|
+
(https://pypi.python.org/pypi/jobqueue). When its maature enough, I will use
|
16
|
+
the ruby version numbers for it.
|
17
|
+
|
14
18
|
== Installation
|
15
19
|
|
16
20
|
=== Gem Installation
|
@@ -80,7 +84,8 @@ please use personal mail, ruby-lang mailing list or github
|
|
80
84
|
|
81
85
|
== Changelog
|
82
86
|
|
83
|
-
* 1.0.
|
87
|
+
* 1.0.11: prun.rb now ignores empty lines
|
88
|
+
* 1.0.10: more flexible logging control (new switches '-l' and '-b')
|
84
89
|
* 1.0.9: print out stdout and stderr from the jobs given to prun.rb, use '-D' to avoid printing
|
85
90
|
* 1.0.8: support AIX for getting the maximum number of processors, improve processor count for jruby and rbx
|
86
91
|
|
data/bin/prun.rb
CHANGED
@@ -50,6 +50,6 @@ ARGV.each do|f|
|
|
50
50
|
lines = File.open(f).readlines.map(&:chomp)
|
51
51
|
q = SystemJobs.new(options[:workers],options[:debug])
|
52
52
|
puts "Run with #{q.workers} threads" unless :off == options[:debug]
|
53
|
-
lines.each {|line| q.push(line) }
|
53
|
+
lines.each {|line| q.push(line) unless line.strip.empty? }
|
54
54
|
q.run
|
55
55
|
end
|
data/gemspec
CHANGED
data/test/test_jobqueue.rb
CHANGED
@@ -5,6 +5,9 @@ require 'tempfile'
|
|
5
5
|
|
6
6
|
|
7
7
|
NTHREDs = ENV['NTHREDs'].nil? ? 4 : ENV['NTHREDs']
|
8
|
+
def prunCall(np,script)
|
9
|
+
"ruby -rubygems ./bin/prun.rb -j #{np} #{script}"
|
10
|
+
end
|
8
11
|
|
9
12
|
class A
|
10
13
|
attr_accessor :i,:j,:k,:h
|
@@ -212,37 +215,48 @@ class TestJobQueue < Test::Unit::TestCase
|
|
212
215
|
script.close
|
213
216
|
filename = script.path
|
214
217
|
puts IO.popen("cat "+script.path).read
|
215
|
-
cmd = lambda {|np,script| "ruby -rubygems ./bin/prun.rb -j #{np} #{script}"}
|
216
218
|
|
217
219
|
# test in debug mode
|
218
220
|
tstart = Time.new
|
219
|
-
puts IO.popen(
|
221
|
+
puts IO.popen(prunCall(4,filename)).read
|
220
222
|
tend = Time.new
|
221
223
|
trun = tend - tstart
|
222
224
|
assert(2.0 < trun,"Test (debug mode) runs to fast: #{trun}, lower limit 2")
|
223
225
|
assert(trun < 3 ,"Test (debug mode) runs to slow: #{trun}, upper limit 3")
|
224
226
|
# test in normal mode
|
225
227
|
tstart = Time.new
|
226
|
-
puts IO.popen(
|
228
|
+
puts IO.popen(prunCall(4,filename)).read
|
227
229
|
tend = Time.new
|
228
230
|
trun = tend - tstart
|
229
231
|
assert(2.0 < trun,"Test (normal mode) runs to fast: #{trun}, lower limit 2")
|
230
232
|
assert(trun < 3 ,"Test (normal mode) runs to slow: #{trun}, upper limit 3")
|
231
233
|
# with 8 threads
|
232
234
|
tstart = Time.new
|
233
|
-
puts IO.popen(
|
235
|
+
puts IO.popen(prunCall(8,filename)).read
|
234
236
|
tend = Time.new
|
235
237
|
trun = tend - tstart
|
236
238
|
assert(1.0 < trun,"Test (debug mode) runs to fast: #{trun}, lower limit 1")
|
237
239
|
assert(trun < 2.0,"Test (debug mode) runs to slow: #{trun}, lower limit 2")
|
238
240
|
# test in normal mode
|
239
241
|
tstart = Time.new
|
240
|
-
puts IO.popen(
|
242
|
+
puts IO.popen(prunCall(8,filename)).read
|
241
243
|
tend = Time.new
|
242
244
|
trun = tend - tstart
|
243
245
|
assert(1.0 < trun,"Test (debug mode) runs to fast: #{trun}, lower limit 1")
|
244
246
|
assert(trun < 2.0,"Test (debug mode) runs to slow: #{trun}, lower limit 2")
|
245
247
|
end
|
248
|
+
def test_prun_crash_on_empty_lines
|
249
|
+
tf = Tempfile.new("jobQueueTest")
|
250
|
+
tp = tf.path
|
251
|
+
tf.write("date\n")
|
252
|
+
tf.write("ls $HOME\n")
|
253
|
+
tf.write( "\n")
|
254
|
+
tf.write( "pwd\n")
|
255
|
+
tf.close
|
256
|
+
puts tp
|
257
|
+
puts IO.popen("cat #{tp}").read
|
258
|
+
puts IO.popen(prunCall(2,tp)).read
|
259
|
+
end
|
246
260
|
|
247
261
|
if 'thingol' == `hostname`.chomp
|
248
262
|
def test_init_without_args
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jobQueue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.11
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ralf Mueller
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-05-17 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Run Shell commands or Ruby methods in parallel
|
15
14
|
email: stark.dreamdetective@gmail.com
|
@@ -29,27 +28,26 @@ files:
|
|
29
28
|
homepage: https://github.com/Try2Code/jobQueue
|
30
29
|
licenses:
|
31
30
|
- BSD
|
31
|
+
metadata: {}
|
32
32
|
post_install_message:
|
33
33
|
rdoc_options: []
|
34
34
|
require_paths:
|
35
35
|
- lib
|
36
36
|
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
37
|
requirements:
|
39
|
-
- -
|
38
|
+
- - '>='
|
40
39
|
- !ruby/object:Gem::Version
|
41
40
|
version: '1.8'
|
42
41
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
42
|
requirements:
|
45
|
-
- -
|
43
|
+
- - '>='
|
46
44
|
- !ruby/object:Gem::Version
|
47
45
|
version: '0'
|
48
46
|
requirements: []
|
49
47
|
rubyforge_project:
|
50
|
-
rubygems_version:
|
48
|
+
rubygems_version: 2.0.0
|
51
49
|
signing_key:
|
52
|
-
specification_version:
|
50
|
+
specification_version: 4
|
53
51
|
summary: Run Shell commands or Ruby methods in parallel
|
54
52
|
test_files:
|
55
53
|
- test/test_jobqueue.rb
|