jobQueue 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/gemspec +1 -1
- data/lib/jobqueue.rb +1 -1
- data/test/test_jobqueue.rb +8 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -65,7 +65,7 @@ script on 10 threads, use:
|
|
65
65
|
prun.rb -j 10 jobs.sh
|
66
66
|
|
67
67
|
The '-j' switch is optional. Default is the maximum number of cores. The script
|
68
|
-
accepts multiple files and processes one after another.
|
68
|
+
accepts multiple files and processes one after another. Try '-h' dor documentation.
|
69
69
|
|
70
70
|
== Support, Issues, Bugs, ...
|
71
71
|
|
data/gemspec
CHANGED
data/lib/jobqueue.rb
CHANGED
@@ -12,7 +12,7 @@ class JobQueue
|
|
12
12
|
attr_reader :workers, :threads
|
13
13
|
|
14
14
|
# Create a new queue qith a given number of worker threads
|
15
|
-
def initialize(nWorkers,debug=false)
|
15
|
+
def initialize(nWorkers=JobQueue.maxnumber_of_processors,debug=false)
|
16
16
|
@workers = nWorkers
|
17
17
|
@queue = Queue.new
|
18
18
|
@debug = debug
|
data/test/test_jobqueue.rb
CHANGED
@@ -201,7 +201,7 @@ class TestJobQueue < Test::Unit::TestCase
|
|
201
201
|
end
|
202
202
|
|
203
203
|
def test_Shell
|
204
|
-
return true if @jq
|
204
|
+
#return true if @jq
|
205
205
|
script = Tempfile.open("jobQueue")
|
206
206
|
(1..8).each {|i| script << "date;echo #{i}; sleep 1\n" }
|
207
207
|
script.close
|
@@ -237,4 +237,11 @@ class TestJobQueue < Test::Unit::TestCase
|
|
237
237
|
assert(1.0 < trun,"Test (debug mode) runs to fast: #{trun}, lower limit 1")
|
238
238
|
assert(trun < 2.0,"Test (debug mode) runs to slow: #{trun}, lower limit 2")
|
239
239
|
end
|
240
|
+
|
241
|
+
if 'thingol' == `hostname`.chomp
|
242
|
+
def test_init_without_args
|
243
|
+
jq = JobQueue.new
|
244
|
+
assert_equal(8,jq.workers)
|
245
|
+
end
|
246
|
+
end
|
240
247
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jobQueue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
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: 2012-
|
12
|
+
date: 2012-02-23 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Run Shell commands or Ruby methods in parallel
|
15
15
|
email: stark.dreamdetective@gmail.com
|