rbbt-util 5.8.3 → 5.8.4
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 +4 -4
- data/lib/rbbt/util/open.rb +1 -1
- data/share/rbbt_commands/workflow/example +37 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c797873ae505de56e3946d6effdb0cabd417c6a
|
4
|
+
data.tar.gz: f191e7f6bd071f97dd3147d0b7c5b672a708c69d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da7d7f21f11c5564514be72b81734958f0a46b742f40a50252f62442dd4089a96c41da2b0d714c8d135d3851699d519c1f4b95fd3a2830dd89d452453cc4ca2e
|
7
|
+
data.tar.gz: e38d5a7d439fda5310a8db460337414e808762a5996fbc7f6413da71c7506b57d91f5b4d6fab28d2f774652614848a20d4016a8476f58f72d5e91e648d66d90b
|
data/lib/rbbt/util/open.rb
CHANGED
@@ -10,24 +10,35 @@ def run_task(workflow, task, name)
|
|
10
10
|
example_dir = workflow.libdir.examples[task][name].find
|
11
11
|
Log.debug "Using #{example_dir}"
|
12
12
|
|
13
|
-
ARGV.replace([workflow.to_s, task, '--load_inputs', example_dir, '--jobname', name,'
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
ARGV.replace([workflow.to_s, task, '--load_inputs', example_dir, '--jobname', name,'-pf'] + $saved_args)
|
14
|
+
|
15
|
+
path = nil
|
16
|
+
TmpFile.with_file do |res|
|
17
|
+
Open.open(res, :mode => 'w') do |file|
|
18
|
+
@pid = Process.fork{
|
19
|
+
STDOUT.reopen res
|
20
|
+
load Rbbt.share.rbbt_commands.workflow.task.find
|
21
|
+
}
|
22
|
+
file.close
|
23
|
+
Signal.trap(:INT) do
|
24
|
+
begin
|
25
|
+
Process.kill "INT", @pid
|
26
|
+
ensure
|
27
|
+
exit -1
|
28
|
+
end
|
29
|
+
end
|
30
|
+
Process.wait @pid
|
23
31
|
end
|
32
|
+
path = Open.read(res) if File.exists? res
|
24
33
|
end
|
25
|
-
|
34
|
+
path = "NO RESULT" if path.nil? or path.empty?
|
26
35
|
|
27
36
|
if $?.success?
|
28
37
|
Log.info "#{Log.color :green, "SUCCESS"} #{Log.color :magenta, workflow.to_s}##{Log.color :yellow, task} -- #{Log.color :cyan, name}"
|
38
|
+
return [path, true]
|
29
39
|
else
|
30
40
|
Log.info "#{Log.color :red, "ERROR"} #{Log.color :magenta, workflow.to_s}##{Log.color :yellow, task} -- #{Log.color :cyan, name}"
|
41
|
+
return [path, false]
|
31
42
|
end
|
32
43
|
end
|
33
44
|
|
@@ -42,14 +53,27 @@ name = nil if name == '--'
|
|
42
53
|
|
43
54
|
$saved_args = ARGV.dup
|
44
55
|
|
45
|
-
|
46
56
|
workflow = Workflow.require_workflow workflow
|
47
57
|
|
48
58
|
tasks = task ? [task] : workflow.libdir.examples.glob('*').collect{|file| File.basename file }
|
49
59
|
|
60
|
+
task_result = {}
|
50
61
|
tasks.each do |task|
|
51
62
|
names = name ? [name] : workflow.libdir.examples[task].glob('*').collect{|file| File.basename file }
|
52
63
|
names.each do |name|
|
53
|
-
run_task workflow, task, name
|
64
|
+
success = run_task workflow, task, name
|
65
|
+
task_result[[task, name]] = success
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
task_result.each do |code,res|
|
70
|
+
task, name = code
|
71
|
+
path, success = res
|
72
|
+
if success
|
73
|
+
puts "#{Log.color :green, "SUCCESS"} #{Log.color :magenta, workflow.to_s}##{Log.color :yellow, task} -- #{Log.color :cyan, name}"
|
74
|
+
puts path
|
75
|
+
else
|
76
|
+
puts "#{Log.color :red, "ERROR"} #{Log.color :magenta, workflow.to_s}##{Log.color :yellow, task} -- #{Log.color :cyan, name}"
|
77
|
+
puts path
|
54
78
|
end
|
55
79
|
end
|