t2-server 0.9.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.rdoc +79 -0
- data/LICENCE.rdoc +1 -1
- data/README.rdoc +94 -26
- data/Rakefile +6 -5
- data/bin/t2-delete-runs +25 -23
- data/bin/t2-get-output +11 -13
- data/bin/t2-run-workflow +91 -29
- data/bin/t2-server-info +29 -12
- data/extras/t2-server-stress +184 -0
- data/lib/t2-server-cli.rb +48 -23
- data/lib/t2-server.rb +2 -1
- data/lib/t2-server/admin.rb +7 -4
- data/lib/t2-server/exceptions.rb +23 -4
- data/lib/t2-server/interaction.rb +241 -0
- data/lib/t2-server/net/connection.rb +90 -60
- data/lib/t2-server/net/credentials.rb +25 -9
- data/lib/t2-server/net/parameters.rb +21 -6
- data/lib/t2-server/port.rb +229 -140
- data/lib/t2-server/run-cache.rb +99 -0
- data/lib/t2-server/run.rb +349 -332
- data/lib/t2-server/server.rb +115 -164
- data/lib/t2-server/util.rb +11 -9
- data/lib/t2-server/xml/libxml.rb +3 -2
- data/lib/t2-server/xml/nokogiri.rb +4 -3
- data/lib/t2-server/xml/rexml.rb +3 -2
- data/lib/t2-server/xml/xml.rb +47 -36
- data/lib/{t2server.rb → t2-server/xml/xpath_cache.rb} +29 -7
- data/t2-server.gemspec +16 -5
- data/test/tc_misc.rb +61 -0
- data/test/tc_perms.rb +17 -1
- data/test/tc_run.rb +164 -34
- data/test/tc_secure.rb +11 -2
- data/test/tc_server.rb +23 -2
- data/test/ts_t2server.rb +10 -8
- data/test/workflows/missing_outputs.t2flow +440 -0
- data/version.yml +3 -3
- metadata +42 -4
data/CHANGES.rdoc
CHANGED
@@ -1,5 +1,84 @@
|
|
1
1
|
= Changes log for the T2 Ruby Gem
|
2
2
|
|
3
|
+
== Version 1.0.0
|
4
|
+
|
5
|
+
* Remove deprecated methods.
|
6
|
+
* Add read streaming capability to the underlying connection.
|
7
|
+
* Add a read method to stream data directly to a file.
|
8
|
+
* Stream zip data from server.
|
9
|
+
* Update t2-run-workflow so that debug is optional.
|
10
|
+
* Stream baclava data from server.
|
11
|
+
* Expose streaming capability to output ports.
|
12
|
+
* Bring port error handling inline with normal values.
|
13
|
+
* Tidy up usage of a mime-type for empty ports.
|
14
|
+
* Add methods to test for empty ports or port values.
|
15
|
+
* Add output port data streaming functionality.
|
16
|
+
* Stream output data directly to a file.
|
17
|
+
* Document the credentials classes.
|
18
|
+
* Add general stream-to-stream data downloads.
|
19
|
+
* Expose stream-to-stream methods in the Run class.
|
20
|
+
* Add upload streaming to the underlying connection.
|
21
|
+
* Stream uploads of workflows and data.
|
22
|
+
* Add streaming examples to the README.
|
23
|
+
* Make XPath searching robust to nodes not being found.
|
24
|
+
* Read interaction feed URI and query support with API.
|
25
|
+
* Read notifications from the interaction feed.
|
26
|
+
* Document the Interaction Service additions in the README.
|
27
|
+
* Add a bit more compatibility info to the Readme.
|
28
|
+
* Clean up run caching code in the Server class.
|
29
|
+
* Clean up variables and comments for run creation.
|
30
|
+
* Code clarity improvements.
|
31
|
+
* Remove duplicated download/streaming code in Run.
|
32
|
+
* Remove duplicate URI stripping code from Server.
|
33
|
+
* Improve readability of the XML fragments.
|
34
|
+
* Add a global complied XPath cache and use for Server.
|
35
|
+
* Use global XPath cache for Run class.
|
36
|
+
* Add Ruby 2.0.0 as known to work in README.
|
37
|
+
* t2-delete-runs: Minor code clean-up.
|
38
|
+
* t2-delete-runs: Add a flag to only delete finished runs.
|
39
|
+
* t2-run-workflow: Minor code clean-up.
|
40
|
+
* t2-run-workflow: Add flag for service credentials.
|
41
|
+
* Server now returns 503 when at capacity.
|
42
|
+
* Server now has a limit on concurrently running runs.
|
43
|
+
* Test for max concurrently running runs.
|
44
|
+
* t2-run-workflow: Cope with hitting max running runs.
|
45
|
+
* t2-server-stress: Cope with hitting max running runs.
|
46
|
+
* Ensure all unit tests delete runs that they create.
|
47
|
+
* Mark deleted runs as such in their Run object.
|
48
|
+
* [TAVSERV-308] Run#permissions returns nil, instead of :none
|
49
|
+
* Add a function to download a single port as a zip file.
|
50
|
+
* Added ssl_version to connection parameters
|
51
|
+
* Put a guard in to check that the SSL version is sensible.
|
52
|
+
* Add SSL version support to the command line tools.
|
53
|
+
* Add a new example connection parameter class for SSL version 3.
|
54
|
+
* Describe the connection parameters in more detail.
|
55
|
+
* Add Run#error? to check all output ports for errors.
|
56
|
+
* UnexpectedServerResponse now provides more information.
|
57
|
+
* Remove the port value caching code.
|
58
|
+
* Simplify the HTTP methods and clean up error handling.
|
59
|
+
* Split up the CLI options code.
|
60
|
+
* Improve version string parsing.
|
61
|
+
* Handle server returning Accepted on run start.
|
62
|
+
* Get the run name from the server.
|
63
|
+
* t2-server-info: Display run names in list view.
|
64
|
+
* Set the run name on the server.
|
65
|
+
* t2-run-workflow: Set name of run on server.
|
66
|
+
* t2-get-output: Get name of run from server.
|
67
|
+
* OutputPort#zip now returns nil for singletons.
|
68
|
+
* Fix well-hidden HTTPS connection setup bug.
|
69
|
+
* Use a RunCache class instead of a Hash to store local run objects.
|
70
|
+
* t2-server-info: Configurable run detail in list view.
|
71
|
+
* [TAVSERV-324] Uninitialized connection parameters.
|
72
|
+
* Move interaction code out of Server, into Run.
|
73
|
+
* Simplifications for per-run feeds.
|
74
|
+
* Get different types of notifications for a Run.
|
75
|
+
* Expose the run notification/interaction locations.
|
76
|
+
* Add Run#log to get run logs.
|
77
|
+
* Add connection timeout parameters.
|
78
|
+
* Enable interaction reply publishing.
|
79
|
+
* Read the interaction serial number from the notification.
|
80
|
+
* Enable retrieval of an interaction's input data.
|
81
|
+
|
3
82
|
== Version 0.9.3
|
4
83
|
|
5
84
|
* Correctly handle missing values in output ports.
|
data/LICENCE.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -4,8 +4,9 @@ Authors:: Robert Haines
|
|
4
4
|
Contact:: mailto:support@mygrid.org.uk
|
5
5
|
URL:: http://www.taverna.org.uk/
|
6
6
|
Licence:: BSD (See LICENCE or http://www.opensource.org/licenses/bsd-license.php)
|
7
|
-
Copyright:: (c) 2010-
|
7
|
+
Copyright:: (c) 2010-2013 The University of Manchester, UK
|
8
8
|
|
9
|
+
{<img src="https://codeclimate.com/github/myGrid/t2-server-gem.png" />}[https://codeclimate.com/github/myGrid/t2-server-gem]
|
9
10
|
|
10
11
|
== Synopsis
|
11
12
|
|
@@ -25,28 +26,41 @@ https://rubygems.org/gems/t2-server
|
|
25
26
|
You can also download the source code from here:
|
26
27
|
https://github.com/myGrid/t2-server-gem
|
27
28
|
|
28
|
-
== Compatibility
|
29
|
+
== Compatibility
|
29
30
|
|
30
|
-
|
31
|
+
After the release of version 1.0.0 this gem will follow the principles of
|
32
|
+
{Semantic Versioning}[http://semver.org/]. Until that point there may be
|
33
|
+
breaking changes to the API, although these will be kept to a minimum.
|
34
|
+
|
35
|
+
=== Taverna Server
|
36
|
+
|
37
|
+
Versions 0.9.x of this library are compatible with Taverna Server 2.3 and 2.4.
|
31
38
|
It is not compatible with any earlier version of Taverna Server due to breaking
|
32
|
-
changes in its REST interface.
|
33
|
-
|
34
|
-
|
39
|
+
changes in its REST interface.
|
40
|
+
|
41
|
+
From version 1.0.0 this library is not guaranteed to be compatible with
|
42
|
+
Taverna Server 2.3. It might work but it is not supported, and may stop working
|
43
|
+
at any time.
|
35
44
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
version 1.0.0 (and are not guaranteed to continue working even until then) so
|
41
|
-
you are advised to update your code at your earliest convenience.
|
45
|
+
Version 1.0.0 of this library saw the removal of older methods that were
|
46
|
+
previously deprecated. If your code no longer works with this version then
|
47
|
+
please re-test it with version 0.9.3 and check for deprecation messages before
|
48
|
+
reporting bugs.
|
42
49
|
|
43
|
-
|
50
|
+
We strongly encourage all users to upgrade to the current version of Taverna
|
51
|
+
Server, but if that is not possible right now then these are the recommended
|
52
|
+
version pairings:
|
53
|
+
* pre Taverna Server 2.3, use version 0.6.1 of the gem
|
54
|
+
* 2.3, use version 0.9.3
|
55
|
+
* 2.4 and up, use version 1.0.0
|
56
|
+
|
57
|
+
=== Ruby
|
44
58
|
|
45
59
|
This library is known to work with the following versions of Ruby:
|
46
|
-
* 1.8.7
|
60
|
+
* 1.8.7
|
47
61
|
* 1.9.2
|
48
62
|
* 1.9.3 *
|
49
|
-
*
|
63
|
+
* 2.0.0
|
50
64
|
|
51
65
|
Those marked with an asterisk (*) are supported and bugs found against them
|
52
66
|
will be fixed. Other versions may work but are not tested or supported.
|
@@ -54,8 +68,8 @@ will be fixed. Other versions may work but are not tested or supported.
|
|
54
68
|
== Usage
|
55
69
|
|
56
70
|
There are two entry points for the T2Server API:
|
57
|
-
*
|
58
|
-
*
|
71
|
+
* T2Server::Run - Use this for running single jobs on a server.
|
72
|
+
* T2Server::Server - Use this if you are providing a web interface to
|
59
73
|
one or more Taverna 2 Server instances.
|
60
74
|
|
61
75
|
In both cases the gem should be initialized by requiring the top level ruby
|
@@ -76,6 +90,9 @@ Connection configuration settings are passed in to various methods using the
|
|
76
90
|
* <tt>:verify_peer</tt> - Use a CA to verify that the Taverna Server you are connecting to has a valid server certificate and that it is the correct one.
|
77
91
|
* <tt>:client_certificate</tt> - A certificate to use for client certificate authentication.
|
78
92
|
* <tt>:client_password</tt> - The password to unlock the private key of the client certificate.
|
93
|
+
* <tt>:ssl_version</tt> - The TLS/SSL version to use (<tt>:TLSv1</tt>, <tt>:SSLv23</tt> or <tt>:SSLv3</tt>)
|
94
|
+
* <tt>:open_timeout</tt> - The number of seconds to wait while opening a connection.
|
95
|
+
* <tt>:read_timeout</tt> - The number of seconds to wait while reading from a connection.
|
79
96
|
|
80
97
|
And can be set like this for a standard https connection:
|
81
98
|
|
@@ -91,9 +108,10 @@ automatically.
|
|
91
108
|
For convenience a number of standard sets of parameters have been defined. The
|
92
109
|
above example is available as +DefaultConnectionParameters+. Others available
|
93
110
|
are:
|
94
|
-
* +InsecureSSLConnectionParameters+ - to ignore SSL checks.
|
111
|
+
* +InsecureSSLConnectionParameters+ - to ignore SSL checks. <b>Not recommended!</b>
|
95
112
|
* +CustomCASSLConnectionParameters+ - for custom (self-signed) CAs.
|
96
113
|
* +ClientAuthSSLConnectionParameters+ - for client certificate authentication.
|
114
|
+
* +SSL3ConnectionParameters+ - uses SSLv3 as the default transport layer.
|
97
115
|
|
98
116
|
See the rdoc for more details on these classes.
|
99
117
|
|
@@ -106,7 +124,7 @@ These are simple to set up:
|
|
106
124
|
|
107
125
|
=== Server API example
|
108
126
|
|
109
|
-
The Server constructor can yield the newly created object.
|
127
|
+
The Server constructor can yield the newly created object. Simply supply a URI
|
110
128
|
and a set of connection parameters to connect to a server:
|
111
129
|
|
112
130
|
T2Server::Server.new(uri, conn_params) do |server|
|
@@ -124,8 +142,11 @@ credentials:
|
|
124
142
|
...
|
125
143
|
end
|
126
144
|
|
127
|
-
|
128
|
-
|
145
|
+
The +workflow+ parameter can be the workflow itself, a filename or a File or
|
146
|
+
IO object.
|
147
|
+
|
148
|
+
An individual run can be deleted with its own <tt>delete</tt> method (see
|
149
|
+
below) but all runs on a server can be deleted in one go:
|
129
150
|
|
130
151
|
server.delete_all_runs(credentials)
|
131
152
|
|
@@ -141,6 +162,9 @@ a couple of runs directly:
|
|
141
162
|
...
|
142
163
|
end
|
143
164
|
|
165
|
+
As before, the +workflow+ parameter can be the workflow itself, a filename or
|
166
|
+
a File or IO object.
|
167
|
+
|
144
168
|
Setting an input port to a run is very easy:
|
145
169
|
|
146
170
|
run.input_port("port_name").value = 1
|
@@ -164,25 +188,69 @@ Or just wait until the run has finished:
|
|
164
188
|
|
165
189
|
run.wait
|
166
190
|
|
167
|
-
|
191
|
+
While a workflow is running it might produce notifications via the
|
192
|
+
{Interaction Service}[http://dev.mygrid.org.uk/wiki/display/taverna/Interaction+service].
|
193
|
+
These can be polled with:
|
194
|
+
|
195
|
+
run.notifications
|
196
|
+
|
197
|
+
If there are any new notifications that have not been responded to they will
|
198
|
+
be returned in a list to be processed. Notifications take the form of a Web
|
199
|
+
page to be displayed and the notification objects returned from the above call
|
200
|
+
hold a URI to that page. The following code prints those URIs to the console:
|
201
|
+
|
202
|
+
run.notifications.each do |i|
|
203
|
+
puts i.uri
|
204
|
+
end
|
205
|
+
|
206
|
+
When the workflow has finished executing then the outputs can be collected
|
207
|
+
into memory or saved to a file:
|
168
208
|
|
169
209
|
result = run.output_port("port_name").value
|
210
|
+
run.output_port("port_name").write_value_to_file("/path/to/value.txt")
|
211
|
+
|
212
|
+
Outputs can be queried as to their type, size (in bytes) or if they contain an
|
213
|
+
error message:
|
214
|
+
|
215
|
+
run.output_port("port_name").type
|
216
|
+
run.output_port("port_name").size
|
217
|
+
run.output_port("port_name").error?
|
170
218
|
|
171
|
-
If
|
219
|
+
If the output does hold an error then it can be found in the value of the
|
220
|
+
output as normal.
|
172
221
|
|
173
|
-
|
222
|
+
If you have a lot of output you can grab the whole lot in a zip archive. This
|
223
|
+
can be downloaded into memory or saved directly to a file.
|
224
|
+
|
225
|
+
zip_data = run.zip_output # download to memory
|
226
|
+
run.zip_output("/path/to/output.zip") # save to a file
|
174
227
|
|
175
228
|
Using baclava documents for setting inputs and collecting outputs is also
|
176
229
|
supported:
|
177
230
|
|
178
231
|
run.baclava_input = filename
|
179
232
|
|
180
|
-
But make sure you request baclava output *before* starting the run
|
233
|
+
But make sure you request baclava output *before* starting the run. Baclava
|
234
|
+
output can be downloaded into memory or saved directly to a file.
|
181
235
|
|
182
236
|
run.request_baclava_output
|
183
237
|
run.start
|
184
238
|
run.wait
|
185
|
-
output = run.baclava_output
|
239
|
+
output = run.baclava_output # download to memory
|
240
|
+
run.baclava_output("/path/to/output.baclava") # save to a file
|
241
|
+
|
242
|
+
The log from Taverna Server can be downloaded in a similar way to zip files or
|
243
|
+
Baclava documents.
|
244
|
+
|
245
|
+
log = run.log # download to memory
|
246
|
+
run.log("/path/to/log.txt") # save to a file
|
247
|
+
|
248
|
+
When downloading outputs the underlying stream can be accessed by supplying a
|
249
|
+
block to the value, zip_output, baclava_output or log methods:
|
250
|
+
|
251
|
+
run.output_port("port_name").value do |data|
|
252
|
+
print data
|
253
|
+
end
|
186
254
|
|
187
255
|
A run can be deleted when no longer needed, like so:
|
188
256
|
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2010-
|
1
|
+
# Copyright (c) 2010-2013 The University of Manchester, UK.
|
2
2
|
#
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
@@ -46,8 +46,8 @@ task :default => [:test]
|
|
46
46
|
Jeweler::Tasks.new do |s|
|
47
47
|
s.name = "t2-server"
|
48
48
|
s.version = T2Server::Version::STRING
|
49
|
-
s.authors = ["Robert Haines"]
|
50
|
-
s.email = ["
|
49
|
+
s.authors = ["Robert Haines", "Finn Bacall"]
|
50
|
+
s.email = ["support@mygrid.org.uk"]
|
51
51
|
s.homepage = "http://www.taverna.org.uk/"
|
52
52
|
s.platform = Gem::Platform::RUBY
|
53
53
|
s.summary = "Support for interacting with Taverna 2 Server."
|
@@ -66,8 +66,10 @@ Jeweler::Tasks.new do |s|
|
|
66
66
|
s.add_development_dependency('nokogiri', '>= 1.5.0')
|
67
67
|
s.add_development_dependency('rdoc', '>= 3.9.4')
|
68
68
|
s.add_development_dependency('jeweler', '~> 1.8.3')
|
69
|
+
s.add_development_dependency('launchy', '~> 2.2.0')
|
69
70
|
s.add_runtime_dependency('net-http-persistent', '~> 2.6')
|
70
71
|
s.add_runtime_dependency('taverna-baclava', '~> 1.0.0')
|
72
|
+
s.add_runtime_dependency('ratom', '~> 0.8.2')
|
71
73
|
s.add_runtime_dependency('hirb', '>= 0.4.0')
|
72
74
|
end
|
73
75
|
|
@@ -95,10 +97,9 @@ end
|
|
95
97
|
RDoc::Task.new do |r|
|
96
98
|
r.main = "README.rdoc"
|
97
99
|
lib = Dir.glob("lib/**/*.rb").delete_if do |item|
|
98
|
-
item.include?("t2server.rb") or
|
99
100
|
item.include?("/xml/") or
|
101
|
+
item.include?("run-cache.rb") or
|
100
102
|
item.include?("connection.rb") or
|
101
|
-
item.include?("credentials.rb") or
|
102
103
|
item.include?("t2-server-cli.rb")
|
103
104
|
end
|
104
105
|
r.rdoc_files.include("README.rdoc", "LICENCE.rdoc", "CHANGES.rdoc", lib)
|
data/bin/t2-delete-runs
CHANGED
@@ -38,16 +38,20 @@ include T2Server::CLI
|
|
38
38
|
|
39
39
|
# set up options
|
40
40
|
options = {}
|
41
|
-
conn_params, creds = register_options("Usage: t2-delete-runs [options] "
|
41
|
+
conn_params, creds = register_options("Usage: t2-delete-runs [options] "\
|
42
42
|
"server-address [run-ids...]") do |opt|
|
43
|
-
opt.separator " Where server-address is the full URI of the server to "
|
43
|
+
opt.separator " Where server-address is the full URI of the server to "\
|
44
44
|
"connect to,"
|
45
|
-
opt.separator " e.g.: http://example.com:8080/taverna, run-ids are the "
|
45
|
+
opt.separator " e.g.: http://example.com:8080/taverna, run-ids are the "\
|
46
46
|
"id numbers"
|
47
47
|
opt.separator " of the runs you want to delete and [options] can be:"
|
48
48
|
opt.on("--all", "Delete all runs on the server") do
|
49
49
|
options[:all] = true
|
50
50
|
end
|
51
|
+
opt.on("-f", "--finished", "Delete only finished runs. Combine with --all "\
|
52
|
+
"to delete all finished runs") do
|
53
|
+
options[:finished] = true
|
54
|
+
end
|
51
55
|
end
|
52
56
|
|
53
57
|
# get runs and server address from the arguments
|
@@ -71,29 +75,27 @@ rescue RuntimeError => e
|
|
71
75
|
exit 1
|
72
76
|
end
|
73
77
|
|
78
|
+
# ...get the runs...
|
79
|
+
server_runs = server.runs(creds)
|
80
|
+
|
74
81
|
# ...and delete them!
|
75
|
-
|
82
|
+
for run in server_runs
|
76
83
|
begin
|
77
|
-
|
84
|
+
if options[:all] || runs.include?(run.id)
|
85
|
+
if options[:finished]
|
86
|
+
run.delete if run.finished?
|
87
|
+
else
|
88
|
+
run.delete
|
89
|
+
end
|
90
|
+
end
|
91
|
+
rescue T2Server::RunNotFoundError => rnf
|
92
|
+
puts "Run '#{run.id}' not found - skipping."
|
93
|
+
next
|
78
94
|
rescue T2Server::AuthorizationError => ae
|
79
|
-
puts "You are not authorized to delete
|
95
|
+
puts "You are not authorized to delete run '#{run.id}' - skipping."
|
96
|
+
next
|
80
97
|
rescue T2Server::T2ServerError => e
|
81
|
-
puts "There was a problem while deleting
|
82
|
-
|
83
|
-
end
|
84
|
-
else
|
85
|
-
for run in runs
|
86
|
-
begin
|
87
|
-
server.delete_run(run, creds)
|
88
|
-
rescue T2Server::RunNotFoundError => rnf
|
89
|
-
puts "Run '#{run}' not found - skipping."
|
90
|
-
next
|
91
|
-
rescue T2Server::AuthorizationError => ae
|
92
|
-
puts "You are not authorized to delete run '#{run}' - skipping."
|
93
|
-
next
|
94
|
-
rescue T2Server::T2ServerError => e
|
95
|
-
puts "There was a problem while deleting run '#{run}' - skipping."
|
96
|
-
next
|
97
|
-
end
|
98
|
+
puts "There was a problem while deleting run '#{run.id}' - skipping."
|
99
|
+
next
|
98
100
|
end
|
99
101
|
end
|
data/bin/t2-get-output
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# Copyright (c) 2010-
|
2
|
+
# Copyright (c) 2010-2013 The University of Manchester, UK.
|
3
3
|
#
|
4
4
|
# All rights reserved.
|
5
5
|
#
|
@@ -53,6 +53,10 @@ conn_params, creds = register_options("Usage: t2-get-output [options] " +
|
|
53
53
|
"are specified then list all the output ports.") do |val|
|
54
54
|
ports << val.chomp
|
55
55
|
end
|
56
|
+
opt.on("-N", "--name", "Return the name of the run. Supported in Taverna "\
|
57
|
+
"Server versions 2.5.0 and up.") do
|
58
|
+
options[:name] = true
|
59
|
+
end
|
56
60
|
opt.on("-x", "--exitcode", "Return the exitcode of the run.") do
|
57
61
|
options[:exitcode] = true
|
58
62
|
end
|
@@ -95,6 +99,8 @@ begin
|
|
95
99
|
server = T2Server::Server.new(uri, conn_params)
|
96
100
|
run = server.run(run_id, creds)
|
97
101
|
|
102
|
+
puts "Run name: #{run.name}" if options[:name]
|
103
|
+
|
98
104
|
ports = run.output_ports.keys if ports.empty?
|
99
105
|
ports.each do |p|
|
100
106
|
port = run.output_port(p)
|
@@ -112,22 +118,14 @@ begin
|
|
112
118
|
p port.type
|
113
119
|
end
|
114
120
|
|
115
|
-
if options[:tsize]
|
116
|
-
puts " Total data size: #{port.total_size}"
|
117
|
-
end
|
121
|
+
puts " Total data size: #{port.total_size}" if options[:tsize]
|
118
122
|
end
|
119
123
|
|
120
|
-
if options[:exitcode]
|
121
|
-
puts "Exitcode: #{run.exitcode}"
|
122
|
-
end
|
124
|
+
puts "Exitcode: #{run.exitcode}" if options[:exitcode]
|
123
125
|
|
124
|
-
if options[:stdout]
|
125
|
-
puts "Stdout: #{run.stdout}"
|
126
|
-
end
|
126
|
+
puts "Stdout: #{run.stdout}" if options[:stdout]
|
127
127
|
|
128
|
-
if options[:stderr]
|
129
|
-
puts "Stderr: #{run.stderr}"
|
130
|
-
end
|
128
|
+
puts "Stderr: #{run.stderr}" if options[:stderr]
|
131
129
|
rescue RuntimeError => e
|
132
130
|
puts e
|
133
131
|
exit 1
|