rbbt-util 5.32.20 → 5.32.21

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
  SHA256:
3
- metadata.gz: 576b7bc079d39a3054c5bdaa3c0b3af5573a26aacd6181fe65e8d450fd3ed148
4
- data.tar.gz: 2dc53972fc0e8504ca327de2f680d29ac5c3df63362359528b25ec21f2c10e9b
3
+ metadata.gz: 14fc2236d4c0852a44d9db76c43aa19c32619cede05e03801a830ec4a996420a
4
+ data.tar.gz: ceed6fe15817c5fd4635b5b96a557ae010d9aa50ccfdb774a03f959d3e93314d
5
5
  SHA512:
6
- metadata.gz: 3cd48cedd0a1957996b59ac51bc56b2b3c8ce8aef54454b1ff10f8f86a08c9df63a60a1d1bad7c29a0741bf687c215f36b628e614b70aa9b8181d687a075364e
7
- data.tar.gz: 8955e34256095ea4c2e66cc6937845f6b13cb4c87e2bc13f5f7bb4844135886407e50e31114c94e0bdba157f63aab4027c7d94add60f85f31e0646aab3bf124f
6
+ metadata.gz: 0f327628991f8906fc353776ee2d887cd79edfa5cb07def1f8dec207ab2d922c3e4b40a141a8fa128904a28bd5b6d84887f3518bd095d98427e14710567f5495
7
+ data.tar.gz: a53a644a91737b2cb0e76c7eb641daeace94537da7c3ded5b993fb936f524522f81b7f06ddd458ba72a3672279e7f66bf670553c8683f21de7d7cff66bac9400
@@ -98,11 +98,12 @@ module Workflow
98
98
  when 'true'
99
99
  dep.clean
100
100
  when 'recursive'
101
- dep.rec_dependencies.each do |d|
101
+ (dep.dependencies + dep.rec_dependencies).uniq.each do |d|
102
+ next if d.overriden
102
103
  d.clean unless config(:remove_dep, d.task_signature, d.task_name, d.workflow.to_s, :default => true).to_s == 'false'
103
104
  end
104
105
  dep.clean unless config(:remove_dep, dep.task_signature, dep.task_name, dep.workflow.to_s, :default => true).to_s == 'false'
105
- end
106
+ end unless dep.overriden
106
107
  else
107
108
  if Open.exists?(dep.files_dir)
108
109
  Open.rm_rf self.files_dir
@@ -71,7 +71,7 @@ module Workflow
71
71
 
72
72
  def setup_override_dependency(dep, workflow, task_name)
73
73
  return [] if dep == :skip || dep == 'skip'
74
- dep = Step === dep ? dep : Workflow.load_step(dep)
74
+ dep = Step === dep ? dep.dup : Workflow.load_step(dep)
75
75
  dep.workflow = workflow
76
76
  dep.info[:name] = dep.name
77
77
  dep.original_task_name ||= dep.task_name if dep.workflow
@@ -83,8 +83,9 @@ module Workflow
83
83
  rescue
84
84
  Log.exception $!
85
85
  end
86
+
86
87
  dep.task_name = task_name
87
- dep.overriden = dep.original_task_name.to_sym
88
+ dep.overriden = dep.original_task_name.to_sym if dep.original_task_name
88
89
 
89
90
  dep.extend step_module
90
91
 
@@ -351,38 +351,6 @@ class Step
351
351
  end
352
352
  end
353
353
 
354
- #connected = true means that dependency searching ends when a result is done
355
- #but dependencies are absent, meanining that the file could have been dropped
356
- #in
357
- def rec_dependencies(connected = false, seen = [])
358
-
359
- # A step result with no info_file means that it was manually
360
- # placed. In that case, do not consider its dependencies
361
- return [] if ! (defined? WorkflowRemoteClient && WorkflowRemoteClient::RemoteStep === self) && ! Open.exists?(self.info_file) && Open.exists?(self.path.to_s)
362
-
363
- return [] if dependencies.nil? or dependencies.empty?
364
-
365
- new_dependencies = []
366
- if self.overriden?
367
- archived_deps = []
368
- else
369
- archived_deps = self.info[:archived_info] ? self.info[:archived_info].keys : []
370
- end
371
-
372
- dependencies.each{|step|
373
- #next if self.done? && Open.exists?(info_file) && info[:dependencies] && info[:dependencies].select{|task,name,path| path == step.path }.empty?
374
- next if archived_deps.include? step.path
375
- next if seen.include? step.path
376
- next if self.done? && connected && ! updatable?
377
-
378
- r = step.rec_dependencies(connected, new_dependencies.collect{|d| d.path})
379
- new_dependencies.concat r
380
- new_dependencies << step
381
- }
382
-
383
- new_dependencies.uniq
384
- end
385
-
386
354
  def writable?
387
355
  Open.writable?(self.path) && Open.writable?(self.info_file)
388
356
  end
@@ -206,7 +206,7 @@ class Step
206
206
  if dup and step.streaming? and not step.result.nil?
207
207
  if dep_step[step.path] and dep_step[step.path].length > 1
208
208
  stream = step.result
209
- other_steps = dep_step[step.path].uniq
209
+ other_steps = dep_step[step.path].uniq.reject{|d| d.overriden }
210
210
  return unless other_steps.length > 1
211
211
  log_dependency_exec(step, "duplicating #{other_steps.length}")
212
212
  copies = Misc.tee_stream_thread_multiple(stream, other_steps.length)
@@ -523,4 +523,36 @@ class Step
523
523
  set_info :dependencies, dependencies.collect{|dep| [dep.task_name, dep.name, dep.path]} if dependencies
524
524
  end
525
525
 
526
+ #connected = true means that dependency searching ends when a result is done
527
+ #but dependencies are absent, meanining that the file could have been dropped
528
+ #in
529
+ def rec_dependencies(connected = false, seen = [])
530
+
531
+ # A step result with no info_file means that it was manually
532
+ # placed. In that case, do not consider its dependencies
533
+ return [] if ! (defined? WorkflowRemoteClient && WorkflowRemoteClient::RemoteStep === self) && ! Open.exists?(self.info_file) && Open.exists?(self.path.to_s)
534
+
535
+ return [] if dependencies.nil? or dependencies.empty?
536
+
537
+ new_dependencies = []
538
+ if self.overriden?
539
+ archived_deps = []
540
+ else
541
+ archived_deps = self.info[:archived_info] ? self.info[:archived_info].keys : []
542
+ end
543
+
544
+ dependencies.each{|step|
545
+ #next if self.done? && Open.exists?(info_file) && info[:dependencies] && info[:dependencies].select{|task,name,path| path == step.path }.empty?
546
+ next if archived_deps.include? step.path
547
+ next if seen.include? step.path
548
+ next if self.done? && connected && ! updatable?
549
+
550
+ r = step.rec_dependencies(connected, new_dependencies.collect{|d| d.path})
551
+ new_dependencies.concat r
552
+ new_dependencies << step
553
+ }
554
+
555
+ new_dependencies.uniq
556
+ end
557
+
526
558
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.32.20
4
+ version: 5.32.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez