rq 3.5.1 → 3.5.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/gemspec.rb +7 -3
- data/lib/rq.rb +1 -1
- data/lib/rq/jobqueue.rb +11 -4
- data/lib/rq/jobrunner.rb +9 -6
- data/lib/rq/resubmitter.rb +2 -2
- metadata +4 -4
- data/rq +0 -4
data/gemspec.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
#! /usr/bin/env gem build
|
2
|
-
|
3
1
|
lib = 'rq'
|
4
|
-
|
2
|
+
|
3
|
+
dirname = File.dirname(__FILE__)
|
4
|
+
lines = IO.readlines(File.join('lib/rq.rb'))
|
5
|
+
line = lines.detect{|line| line =~ /VERSION =/}
|
6
|
+
version = line.split(/=/).last.scan(/[\d.]+/).first
|
5
7
|
|
6
8
|
require 'rubygems'
|
7
9
|
|
@@ -15,6 +17,8 @@ Gem::Specification::new do |spec|
|
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
20
|
+
spec.name = lib
|
21
|
+
spec.description = 'ruby queue is a zero-admin zero-configuration tool used to create instant unix clusters'
|
18
22
|
spec.name = lib
|
19
23
|
spec.version = version
|
20
24
|
spec.platform = Gem::Platform::RUBY
|
data/lib/rq.rb
CHANGED
@@ -7,7 +7,7 @@ unless defined? $__rq__
|
|
7
7
|
|
8
8
|
AUTHOR = 'ara.t.howard@gmail.com'
|
9
9
|
LIBNAME = 'rq'
|
10
|
-
VERSION = '3.5.
|
10
|
+
VERSION = '3.5.3'
|
11
11
|
LIBVER = "#{ LIBNAME }-#{ VERSION }"
|
12
12
|
DIRNAME = File::dirname(File::expand_path(__FILE__)) + File::SEPARATOR
|
13
13
|
ROOTDIR = File::dirname(DIRNAME)
|
data/lib/rq/jobqueue.rb
CHANGED
@@ -215,13 +215,20 @@ unless defined? $__rq_jobqueue__
|
|
215
215
|
|
216
216
|
execute(sql){}
|
217
217
|
|
218
|
-
FileUtils::rm_rf standard_in_4(jid)
|
219
|
-
FileUtils::rm_rf standard_out_4(jid)
|
220
|
-
FileUtils::rm_rf standard_err_4(jid)
|
221
218
|
#FileUtils::rm_rf data_4(jid)
|
219
|
+
=begin
|
220
|
+
p :job => job
|
221
|
+
p :ts => ts
|
222
|
+
p :pwd => Dir.pwd
|
223
|
+
p :data => data
|
224
|
+
p :data_4 => data_4(jid)
|
225
|
+
p :standard_in_4 => standard_in_4(jid)
|
226
|
+
exit!(1)
|
227
|
+
=end
|
222
228
|
FileUtils::cp ts.path, standard_in_4(jid) if ts
|
229
|
+
|
223
230
|
if data
|
224
|
-
FileUtils::
|
231
|
+
FileUtils::cp data, data_4(jid)
|
225
232
|
else
|
226
233
|
FileUtils::mkdir_p data_4(jid)
|
227
234
|
end
|
data/lib/rq/jobrunner.rb
CHANGED
@@ -56,10 +56,15 @@ unless defined? $__rq_jobrunner__
|
|
56
56
|
@stderr = @job['stderr']
|
57
57
|
@data = @job['data']
|
58
58
|
|
59
|
-
@stdin &&= File::join
|
60
|
-
@stdout &&= File::join
|
61
|
-
@stderr &&= File::join
|
62
|
-
@data &&= File::join
|
59
|
+
@stdin &&= File::join(@q.path, @stdin) # assume path relative to queue
|
60
|
+
@stdout &&= File::join(@q.path, @stdout) # assume path relative to queue
|
61
|
+
@stderr &&= File::join(@q.path, @stderr) # assume path relative to queue
|
62
|
+
@data &&= File::join(@q.path, @data) # assume path relative to queue
|
63
|
+
|
64
|
+
[@stdin, @stdout, @stderr].each do |path|
|
65
|
+
FileUtils::mkdir_p(FileUtils::dirname(path)) rescue nil
|
66
|
+
FileUtils::touch(path) unless File.exist?(path)
|
67
|
+
end
|
63
68
|
|
64
69
|
@cid =
|
65
70
|
Util::fork do
|
@@ -96,8 +101,6 @@ unless defined? $__rq_jobrunner__
|
|
96
101
|
"( ( #{ command } ;) #{ sin } #{ sout } ) #{ serr }"
|
97
102
|
end
|
98
103
|
|
99
|
-
FileUtils::touch(@stdin) unless File.exist?(@stdin)
|
100
|
-
|
101
104
|
@w.puts command
|
102
105
|
@w.close
|
103
106
|
#--}}}
|
data/lib/rq/resubmitter.rb
CHANGED
@@ -77,8 +77,8 @@ unless defined? $__rq_resubmitter__
|
|
77
77
|
job['tag'] = @tag if @options.has_key?('tag')
|
78
78
|
job['runner'] = @runner if @options.has_key?('runner')
|
79
79
|
job['restartable'] = @restartable if @options.has_key?('restartable')
|
80
|
-
job['stdin'] = @job_stdin
|
81
|
-
job['data'] = @data
|
80
|
+
job['stdin'] = @job_stdin
|
81
|
+
job['data'] = @data
|
82
82
|
unless job['state'] =~ %r/running/io
|
83
83
|
resubmitted = nil
|
84
84
|
@q.resubmit(job){|resubmitted|}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.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-03-
|
12
|
+
date: 2013-03-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: arrayfields
|
@@ -59,7 +59,8 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
description:
|
62
|
+
description: ruby queue is a zero-admin zero-configuration tool used to create instant
|
63
|
+
unix clusters
|
63
64
|
email: ara.t.howard@gmail.com
|
64
65
|
executables:
|
65
66
|
- rq
|
@@ -132,7 +133,6 @@ files:
|
|
132
133
|
- Makefile
|
133
134
|
- rdoc.sh
|
134
135
|
- README
|
135
|
-
- rq
|
136
136
|
- TODO
|
137
137
|
- TUTORIAL
|
138
138
|
- white_box/crontab
|