SciMed-bj 1.2.5 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/SciMed-bj.gemspec +2 -2
  2. data/VERSION +1 -1
  3. data/lib/bj/runner.rb +3 -42
  4. metadata +5 -5
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{SciMed-bj}
8
- s.version = "1.2.5"
8
+ s.version = "1.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ara T. Howard", "Joshua Warchol", "Jens Kraemer"]
12
- s.date = %q{2011-08-23}
12
+ s.date = %q{2011-11-29}
13
13
  s.default_executable = %q{bj}
14
14
  s.description = %q{Forked ahoward/bj because the way the bin/bj before_run method interacts with Main's logger= instance menthod breaks in Ruby 1.8.7. Forked again to add missing 'require logger'}
15
15
  s.email = ["josh.warchol@vibes.com", "jk@jkraemer.net"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.5
1
+ 1.3.0
@@ -195,51 +195,12 @@ class Bj
195
195
  :lock => true
196
196
  throw :no_jobs unless job
197
197
 
198
- job.state = "running"
199
- job.save!
200
- job.reload
201
-
202
198
  Bj.logger.info{ "#{ job.title } - starting..." }
203
-
204
- command = job.command
205
- env = job.env ? YAML.load(job.env) : {}
206
- stdin = job.stdin || ''
207
- stdout = job.stdout || ''
208
- stderr = job.stderr || ''
209
-
210
- started_at = Time.now
211
-
212
- thread = Util.start command, :cwd=>Bj.rails_root, :env=>env, :stdin=>stdin, :stdout=>stdout, :stderr=>stderr
213
-
214
- job.state = "running"
215
- job.runner = Bj.hostname
216
- job.pid = thread.pid
217
- job.started_at = started_at
218
- job.save!
219
- job.reload
220
199
  end
221
200
 
222
201
  job.run!
223
202
 
224
- =begin
225
- exit_status = thread.value
226
- finished_at = Time.now
227
-
228
- Bj.transaction(options) do
229
- job = Bj::Table::Job.find job.id
230
- break unless job
231
- job.state = "finished"
232
- job.finished_at = finished_at
233
- job.stdout = stdout
234
- job.stderr = stderr
235
- job.exit_status = exit_status
236
- job.save!
237
- job.reload
238
- Bj.logger.info{ "#{ job.title } - exit_status=#{ job.exit_status }" }
239
- end
240
- =end
241
-
242
- Bj.logger.info{ "#{ job.title } - exit_status=#{ job.exit_status }" }
203
+ Bj.logger.info{ "#{ job.title } - exit_status=#{ job.exit_status }" }
243
204
  end
244
205
  end
245
206
 
@@ -248,7 +209,7 @@ class Bj
248
209
  break if Runner.hup_signaled?
249
210
  break if Runner.kill_signaled?
250
211
  sleep 1
251
- end
212
+ end
252
213
 
253
214
  break unless(limit or limit == false)
254
215
  break if Runner.kill_signaled?
@@ -257,7 +218,7 @@ class Bj
257
218
 
258
219
  def ping_parent
259
220
  ppid = options[:ppid]
260
- return unless ppid
221
+ return unless ppid
261
222
  begin
262
223
  Process.kill 0, Integer(ppid)
263
224
  rescue Errno::ESRCH
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SciMed-bj
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 2
9
- - 5
10
- version: 1.2.5
8
+ - 3
9
+ - 0
10
+ version: 1.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ara T. Howard
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-08-23 00:00:00 -04:00
20
+ date: 2011-11-29 00:00:00 -05:00
21
21
  default_executable: bj
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency