rbbt-util 5.21.125 → 5.21.126

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f4308847ea6b93d07967434826c0e6653085329
4
- data.tar.gz: 7612101d90cc312ae800df4cc6959d5dbe7fd126
3
+ metadata.gz: b25c57ba759c64c90f84606b1903060f3551cf20
4
+ data.tar.gz: d11206948af6273c56a6ac051a1ca3e064214a72
5
5
  SHA512:
6
- metadata.gz: be5ce8fc22674fee613268e576f051f4fc30bd1de0943fd4ae655442e234936da7d5a7dd7691904c8ad36ccaf3b87edbd087262946f142869a2f8cc213bddabf
7
- data.tar.gz: 7b21c5b128e898ee61f08a89ee9d45ad9eea8f0da549682adb70e27ac9c688e3e319f81bafeef206b53940240bf4e29d7788cd1bc5a4ea5c5de652a736301e9b
6
+ metadata.gz: a79b14310fb16641876d4b84629f3af35a783a42c7785019ff7bdd9c44492930f80c3293e36fb966b66e4ff86c668a2823c48465da7ad011e0bf7bb6958e625b
7
+ data.tar.gz: 78ef5d0e917fe5c5be16b453cb94a757397c46c3d20d38fe2a67b0c2ea26800cdb3f33e0e223444b0b5c2371e173c0d6a654f5005d9f0e6b21997178bd56fc49
@@ -275,6 +275,7 @@ class Step
275
275
  res
276
276
  rescue
277
277
  Log.exception $!
278
+ raise $!
278
279
  end
279
280
  end
280
281
  end
@@ -49,9 +49,11 @@ module Workflow
49
49
  IndiferentHash.setup(inputs)
50
50
  end
51
51
 
52
- def example_step(task_name, example)
52
+ def example_inputs(task_name, example)
53
53
  inputs = {}
54
+ IndiferentHash.setup(input)
54
55
  example(task_name, example).each do |input,type,file|
56
+ next if new_inputs.include? input
55
57
 
56
58
  case type
57
59
  when :tsv, :array, :text
@@ -64,6 +66,18 @@ module Workflow
64
66
  inputs[input.to_sym] = file.read.strip
65
67
  end
66
68
  end
69
+ inputs
70
+ end
71
+
72
+
73
+ def example_step(task_name, example, new_inputs = {})
74
+ inputs = example_inputs(task_name, example)
75
+
76
+ if new_inputs and new_inputs.any?
77
+ IndiferentHash.setup(new_inputs)
78
+ inputs = inputs.merge(new_inputs)
79
+ end
80
+
67
81
  self.job(task_name, example, inputs)
68
82
  end
69
83
  end
@@ -87,14 +87,14 @@ if inputs and inputs.any?
87
87
  inputs.each do |input,value|
88
88
  case value
89
89
  when nil
90
- puts " " << Misc.format_definition_list_item(input, 'nil', 80, 20, :blue)
90
+ puts Misc.format_definition_list_item(" " + input.to_s, 'nil', 80, 20, :blue)
91
91
  when Array
92
- puts " " << Misc.format_definition_list_item(input, (value.length > 6 ? value[0..5]*"\n" << "\n" << "..." : value * "\n" ), 80, 20, :blue)
92
+ puts Misc.format_definition_list_item(" " + input.to_s, (value.length > 6 ? value[0..5]*"\n" << "\n" << "..." : value * "\n" ), 80, 20, :blue)
93
93
  when TrueClass, FalseClass
94
- puts " " << Misc.format_definition_list_item(input, value.to_s, 80, 20, :blue)
94
+ puts Misc.format_definition_list_item(" " + input.to_s, value.to_s, 80, 20, :blue)
95
95
  else
96
96
  text = value.to_s.split("\n")[0..5].compact * "\n\n"
97
- puts " " << Misc.format_definition_list_item(input, text, 80, 20, :blue)
97
+ puts Misc.format_definition_list_item(" " + input.to_s, text, 80, 20, :blue)
98
98
  end
99
99
  end
100
100
  end
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.21.125
4
+ version: 5.21.126
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-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake