t2-server 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/t2server.rb +1 -1
- data/lib/t2server/run.rb +17 -18
- data/lib/t2server/server.rb +7 -8
- metadata +4 -4
data/README.rdoc
CHANGED
data/lib/t2server.rb
CHANGED
@@ -43,7 +43,7 @@ require 't2server/run'
|
|
43
43
|
# Taverna 2 Server instance.
|
44
44
|
module T2Server
|
45
45
|
# The version of this library
|
46
|
-
GEM_VERSION = "0.
|
46
|
+
GEM_VERSION = "0.2.1"
|
47
47
|
# The version of the Taverna 2 Server API that this library can interface with
|
48
48
|
API_VERSION = "2.2a1"
|
49
49
|
end
|
data/lib/t2server/run.rb
CHANGED
@@ -31,7 +31,6 @@
|
|
31
31
|
# Author: Robert Haines
|
32
32
|
|
33
33
|
require 'rexml/document'
|
34
|
-
include REXML
|
35
34
|
|
36
35
|
module T2Server
|
37
36
|
|
@@ -361,14 +360,14 @@ module T2Server
|
|
361
360
|
def ls(dir="")
|
362
361
|
dir.strip_path!
|
363
362
|
dir_list = @server.get_run_attribute(@uuid, "#{@links[:wdir]}/#{dir}")
|
364
|
-
doc = Document.new(dir_list)
|
363
|
+
doc = REXML::Document.new(dir_list)
|
365
364
|
|
366
365
|
# compile a list of directory entries stripping the
|
367
366
|
# directory name from the front of each filename
|
368
367
|
dirs = []
|
369
368
|
files = []
|
370
|
-
XPath.each(doc, "//nss:dir", Namespaces::MAP) {|e| dirs << e.text.split('/')[-1]}
|
371
|
-
XPath.each(doc, "//nss:file", Namespaces::MAP) {|e| files << e.text.split('/')[-1]}
|
369
|
+
REXML::XPath.each(doc, "//nss:dir", Namespaces::MAP) {|e| dirs << e.text.split('/')[-1]}
|
370
|
+
REXML::XPath.each(doc, "//nss:file", Namespaces::MAP) {|e| files << e.text.split('/')[-1]}
|
372
371
|
[dirs, files]
|
373
372
|
end
|
374
373
|
|
@@ -427,9 +426,9 @@ module T2Server
|
|
427
426
|
|
428
427
|
# get inputs
|
429
428
|
inputs = @server.get_run_attribute(@uuid, links[:inputs])
|
430
|
-
doc = Document.new(inputs)
|
429
|
+
doc = REXML::Document.new(inputs)
|
431
430
|
nsmap = Namespaces::MAP
|
432
|
-
links[:baclava] = "#{links[:inputs]}/" + XPath.first(doc, "//nsr:baclava", nsmap).attributes["href"].split('/')[-1]
|
431
|
+
links[:baclava] = "#{links[:inputs]}/" + REXML::XPath.first(doc, "//nsr:baclava", nsmap).attributes["href"].split('/')[-1]
|
433
432
|
|
434
433
|
# set io properties
|
435
434
|
links[:io] = "#{links[:listeners]}/io"
|
@@ -441,20 +440,20 @@ module T2Server
|
|
441
440
|
end
|
442
441
|
|
443
442
|
def parse_description(desc)
|
444
|
-
doc = Document.new(desc)
|
443
|
+
doc = REXML::Document.new(desc)
|
445
444
|
nsmap = Namespaces::MAP
|
446
445
|
{
|
447
|
-
:expiry => XPath.first(doc, "//nsr:expiry", nsmap).attributes["href"].split('/')[-1],
|
448
|
-
:workflow => XPath.first(doc, "//nsr:creationWorkflow", nsmap).attributes["href"].split('/')[-1],
|
449
|
-
:status => XPath.first(doc, "//nsr:status", nsmap).attributes["href"].split('/')[-1],
|
450
|
-
:createtime => XPath.first(doc, "//nsr:createTime", nsmap).attributes["href"].split('/')[-1],
|
451
|
-
:starttime => XPath.first(doc, "//nsr:startTime", nsmap).attributes["href"].split('/')[-1],
|
452
|
-
:finishtime => XPath.first(doc, "//nsr:finishTime", nsmap).attributes["href"].split('/')[-1],
|
453
|
-
:wdir => XPath.first(doc, "//nsr:workingDirectory", nsmap).attributes["href"].split('/')[-1],
|
454
|
-
:inputs => XPath.first(doc, "//nsr:inputs", nsmap).attributes["href"].split('/')[-1],
|
455
|
-
:output => XPath.first(doc, "//nsr:output", nsmap).attributes["href"].split('/')[-1],
|
456
|
-
:securectx => XPath.first(doc, "//nsr:securityContext", nsmap).attributes["href"].split('/')[-1],
|
457
|
-
:listeners => XPath.first(doc, "//nsr:listeners", nsmap).attributes["href"].split('/')[-1]
|
446
|
+
:expiry => REXML::XPath.first(doc, "//nsr:expiry", nsmap).attributes["href"].split('/')[-1],
|
447
|
+
:workflow => REXML::XPath.first(doc, "//nsr:creationWorkflow", nsmap).attributes["href"].split('/')[-1],
|
448
|
+
:status => REXML::XPath.first(doc, "//nsr:status", nsmap).attributes["href"].split('/')[-1],
|
449
|
+
:createtime => REXML::XPath.first(doc, "//nsr:createTime", nsmap).attributes["href"].split('/')[-1],
|
450
|
+
:starttime => REXML::XPath.first(doc, "//nsr:startTime", nsmap).attributes["href"].split('/')[-1],
|
451
|
+
:finishtime => REXML::XPath.first(doc, "//nsr:finishTime", nsmap).attributes["href"].split('/')[-1],
|
452
|
+
:wdir => REXML::XPath.first(doc, "//nsr:workingDirectory", nsmap).attributes["href"].split('/')[-1],
|
453
|
+
:inputs => REXML::XPath.first(doc, "//nsr:inputs", nsmap).attributes["href"].split('/')[-1],
|
454
|
+
:output => REXML::XPath.first(doc, "//nsr:output", nsmap).attributes["href"].split('/')[-1],
|
455
|
+
:securectx => REXML::XPath.first(doc, "//nsr:securityContext", nsmap).attributes["href"].split('/')[-1],
|
456
|
+
:listeners => REXML::XPath.first(doc, "//nsr:listeners", nsmap).attributes["href"].split('/')[-1]
|
458
457
|
}
|
459
458
|
end
|
460
459
|
end
|
data/lib/t2server/server.rb
CHANGED
@@ -34,7 +34,6 @@ require 'base64'
|
|
34
34
|
require 'uri'
|
35
35
|
require 'net/https'
|
36
36
|
require 'rexml/document'
|
37
|
-
include REXML
|
38
37
|
|
39
38
|
module T2Server
|
40
39
|
|
@@ -394,24 +393,24 @@ module T2Server
|
|
394
393
|
end
|
395
394
|
|
396
395
|
def parse_description(desc)
|
397
|
-
doc = Document.new(desc)
|
396
|
+
doc = REXML::Document.new(desc)
|
398
397
|
nsmap = Namespaces::MAP
|
399
398
|
{
|
400
|
-
:runs => URI.parse(XPath.first(doc, "//nsr:runs", nsmap).attributes["href"]).path,
|
401
|
-
:runlimit => URI.parse(XPath.first(doc, "//nsr:runLimit", nsmap).attributes["href"]).path,
|
402
|
-
:permworkflows => URI.parse(XPath.first(doc, "//nsr:permittedWorkflows", nsmap).attributes["href"]).path,
|
403
|
-
:permlisteners => URI.parse(XPath.first(doc, "//nsr:permittedListeners", nsmap).attributes["href"]).path
|
399
|
+
:runs => URI.parse(REXML::XPath.first(doc, "//nsr:runs", nsmap).attributes["href"]).path,
|
400
|
+
:runlimit => URI.parse(REXML::XPath.first(doc, "//nsr:runLimit", nsmap).attributes["href"]).path,
|
401
|
+
:permworkflows => URI.parse(REXML::XPath.first(doc, "//nsr:permittedWorkflows", nsmap).attributes["href"]).path,
|
402
|
+
:permlisteners => URI.parse(REXML::XPath.first(doc, "//nsr:permittedListeners", nsmap).attributes["href"]).path
|
404
403
|
}
|
405
404
|
end
|
406
405
|
|
407
406
|
def get_runs
|
408
407
|
run_list = get_attribute("#{@links[:runs]}")
|
409
408
|
|
410
|
-
doc = Document.new(run_list)
|
409
|
+
doc = REXML::Document.new(run_list)
|
411
410
|
|
412
411
|
# get list of run uuids
|
413
412
|
uuids = []
|
414
|
-
XPath.each(doc, "//nsr:run", Namespaces::MAP) do |run|
|
413
|
+
REXML::XPath.each(doc, "//nsr:run", Namespaces::MAP) do |run|
|
415
414
|
uuids << run.attributes["href"].split('/')[-1]
|
416
415
|
end
|
417
416
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t2-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Robert Haines
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-23 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|