rbbt-util 5.23.17 → 5.23.18

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b741d19f2b817da6421a86a354264aabedae4397
4
- data.tar.gz: 5003c159ae149e9a1660acfa939080c3895b08d7
3
+ metadata.gz: 39526da82633a38054bbce4d640d5006f0e2f3d2
4
+ data.tar.gz: 2bb4766c1d2aea82fa9cdbccfa4ebc8f6ef49deb
5
5
  SHA512:
6
- metadata.gz: 7f14b692b30f79dfd99d859c66d2a51313d83f3f1e704bb08a7a89baa0c69aacdadaf331a998c48958f066c73f8eecc050216c23de774c23461070ca3d3c5e9a
7
- data.tar.gz: 6755c1770e04c17b779f63d22649230018d0480fad203fe56033a295d75f0989d63c97fffeee0a1c70b031ce27186d5cbaa05c22be1eeff42500cab170813e0c
6
+ metadata.gz: bc8a05f50a9615be78b3cf65cac028208e02d8a00b0fdca73ddd389258e1e836cc573d25dcf90fb45805a322a204794f137ebb58f270f351c8646c6e2ec014f7
7
+ data.tar.gz: 1a9a0b9baf29b552cf4d19f0343d1154dccc87ecbe522226f49c6090b6c631ae1680505eedaa483aa117020583562679c3211c5ad5c4b0376ed559e187e5cb03
@@ -99,11 +99,11 @@ module Log
99
99
  if @history.length > 3
100
100
 
101
101
  sticks, stime = @history.first
102
- ssticks, sstime = @history[3]
102
+ ssticks, sstime = @history[-3]
103
103
  lticks, ltime = @history.last
104
104
 
105
105
  mean = @mean = (lticks - sticks).to_f / (ltime - stime)
106
- short_mean = (ssticks - sticks).to_f / (sstime - stime)
106
+ short_mean = (lticks - ssticks).to_f / (ltime - sstime)
107
107
 
108
108
  @mean_max = mean if mean > @mean_max
109
109
  end
@@ -74,12 +74,16 @@ module Log
74
74
  def self.with_bar(max, options = {})
75
75
  bar = new_bar(max, options)
76
76
  begin
77
+ error = false
77
78
  yield bar
78
79
  keep = false
79
80
  rescue KeepBar
80
81
  keep = true
82
+ rescue
83
+ error = true
84
+ raise $!
81
85
  ensure
82
- remove_bar(bar) if bar
86
+ remove_bar(bar, error) if bar
83
87
  end
84
88
  end
85
89
  end
@@ -16,6 +16,7 @@ class Aborted < StandardError; end
16
16
 
17
17
  class TryAgain < StandardError; end
18
18
  class SemaphoreInterrupted < TryAgain; end
19
+ class LockInterrupted < TryAgain; end
19
20
 
20
21
  class RemoteServerError < RbbtException; end
21
22
 
@@ -26,21 +26,25 @@ module Misc
26
26
  FileUtils.mkdir_p File.dirname(File.expand_path(file)) unless File.exist? File.dirname(File.expand_path(file))
27
27
 
28
28
 
29
- case options[:lock]
30
- when Lockfile
31
- lockfile = options[:lock]
32
- lockfile.lock unless lockfile.locked?
33
- when FalseClass
34
- lockfile = nil
35
- unlock = false
36
- when Path, String
37
- lock_path = options[:lock].find
38
- lockfile = Lockfile.new(lock_path, options)
39
- lockfile.lock
40
- else
41
- lock_path = File.expand_path(file + '.lock')
42
- lockfile = Lockfile.new(lock_path, options)
43
- lockfile.lock
29
+ begin
30
+ case options[:lock]
31
+ when Lockfile
32
+ lockfile = options[:lock]
33
+ lockfile.lock unless lockfile.locked?
34
+ when FalseClass
35
+ lockfile = nil
36
+ unlock = false
37
+ when Path, String
38
+ lock_path = options[:lock].find
39
+ lockfile = Lockfile.new(lock_path, options)
40
+ lockfile.lock
41
+ else
42
+ lock_path = File.expand_path(file + '.lock')
43
+ lockfile = Lockfile.new(lock_path, options)
44
+ lockfile.lock
45
+ end
46
+ rescue Aborted, Interrupt
47
+ raise LockInterrupted
44
48
  end
45
49
 
46
50
  res = nil
data/lib/rbbt/workflow.rb CHANGED
@@ -308,7 +308,7 @@ module Workflow
308
308
  Workflow.resolve_locals(inputs)
309
309
 
310
310
  task_info = task_info(taskname)
311
- task_inputs = task_info[:inputs]
311
+ task_inputs = task.inputs
312
312
  #defaults = IndiferentHash.setup(task_info[:input_defaults]).merge(task.input_defaults)
313
313
  defaults = IndiferentHash.setup(task.input_defaults)
314
314
 
@@ -338,8 +338,8 @@ module Workflow
338
338
  real_inputs = {}
339
339
 
340
340
  inputs.each do |k,v|
341
- default = defaults[k]
342
341
  next unless (task_inputs.include?(k.to_sym) or task_inputs.include?(k.to_s))
342
+ default = defaults[k]
343
343
  next if default == v
344
344
  next if (String === default and Symbol === v and v.to_s == default)
345
345
  next if (Symbol === default and String === v and v == default.to_s)
@@ -405,7 +405,11 @@ module Workflow
405
405
  end
406
406
 
407
407
  def load_id(id)
408
- path = File.join(workdir, id)
408
+ path = if Path === workdir
409
+ workdir[id].find
410
+ else
411
+ File.join(workdir, id)
412
+ end
409
413
  task = task_for path
410
414
  return remote_tasks[task].load_id(id) if remote_tasks and remote_tasks.include? task
411
415
  step = Step.new path, tasks[task.to_sym]
@@ -391,6 +391,8 @@ class Step
391
391
  res
392
392
  rescue DependencyError
393
393
  exception $!
394
+ rescue LockInterrupted
395
+ raise $!
394
396
  rescue Aborted, Interrupt
395
397
  abort
396
398
  stop_dependencies
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.23.17
4
+ version: 5.23.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-15 00:00:00.000000000 Z
11
+ date: 2018-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake