torquespec 0.3.9.i → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/torquespec/as7.rb +15 -14
- data/lib/torquespec/version.rb +1 -1
- data/spec/empty_spec.rb +1 -1
- data/spec/remote_spec.rb +1 -1
- metadata +10 -13
data/lib/torquespec/as7.rb
CHANGED
@@ -14,7 +14,7 @@ module TorqueSpec
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def shutdown
|
17
|
-
|
17
|
+
api( :operation => "shutdown" )
|
18
18
|
rescue EOFError
|
19
19
|
# ignorable
|
20
20
|
end
|
@@ -22,30 +22,30 @@ module TorqueSpec
|
|
22
22
|
def _deploy(path)
|
23
23
|
once = true
|
24
24
|
begin
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
rescue Exception
|
25
|
+
api( :operation => "add",
|
26
|
+
:address => [ "deployment", addressify(path) ],
|
27
|
+
:content => [ { :url=>urlify(path)} ] )
|
28
|
+
rescue Exception
|
29
29
|
_undeploy(path)
|
30
30
|
if once
|
31
31
|
once = false
|
32
32
|
retry
|
33
33
|
else
|
34
|
-
raise
|
34
|
+
raise
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
38
|
-
|
37
|
+
api( :operation => "deploy",
|
38
|
+
:address => [ "deployment", addressify(path) ] )
|
39
39
|
end
|
40
40
|
|
41
41
|
def _undeploy(path)
|
42
|
-
|
43
|
-
|
42
|
+
api( :operation => "remove",
|
43
|
+
:address => [ "deployment", addressify(path) ] )
|
44
44
|
end
|
45
45
|
|
46
46
|
def ready?
|
47
|
-
response = JSON.parse(
|
48
|
-
|
47
|
+
response = JSON.parse( api( :operation => "read-attribute",
|
48
|
+
:name => "server-state") )
|
49
49
|
response['outcome'].downcase=='success' && response['result'].downcase=='running'
|
50
50
|
rescue
|
51
51
|
false
|
@@ -53,12 +53,13 @@ module TorqueSpec
|
|
53
53
|
|
54
54
|
private
|
55
55
|
|
56
|
-
def
|
56
|
+
def api(params)
|
57
57
|
post('/management', params.merge('json.pretty' => 1).to_json)
|
58
58
|
end
|
59
59
|
|
60
60
|
def urlify(path)
|
61
|
-
URI.parse(path)
|
61
|
+
uri = URI.parse(path)
|
62
|
+
uri.scheme.nil? || uri.scheme =~ /^[a-zA-Z]$/ ? "file:#{path}" : path
|
62
63
|
end
|
63
64
|
|
64
65
|
def addressify(path)
|
data/lib/torquespec/version.rb
CHANGED
data/spec/empty_spec.rb
CHANGED
@@ -4,7 +4,7 @@ remote_describe "in-container tests without a deploy call" do
|
|
4
4
|
|
5
5
|
it "should work" do
|
6
6
|
require 'torquebox/messaging/queue'
|
7
|
-
queue = TorqueBox::Messaging::Queue.start('/queues/foo'
|
7
|
+
queue = TorqueBox::Messaging::Queue.start('/queues/foo')
|
8
8
|
queue.publish('bar')
|
9
9
|
queue.receive.should == 'bar'
|
10
10
|
queue.stop
|
data/spec/remote_spec.rb
CHANGED
@@ -18,7 +18,7 @@ remote_describe "in-container tests" do
|
|
18
18
|
|
19
19
|
it "should work" do
|
20
20
|
require 'torquebox/messaging/queue'
|
21
|
-
queue = TorqueBox::Messaging::Queue.start('/queues/foo'
|
21
|
+
queue = TorqueBox::Messaging::Queue.start('/queues/foo')
|
22
22
|
queue.publish('bar')
|
23
23
|
queue.receive.should == 'bar'
|
24
24
|
queue.stop
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torquespec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
|
11
|
-
version: 0.3.9.i
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 0.4.0
|
12
11
|
platform: ruby
|
13
12
|
authors:
|
14
13
|
- Jim Crossley
|
@@ -17,7 +16,7 @@ autorequire:
|
|
17
16
|
bindir: bin
|
18
17
|
cert_chain: []
|
19
18
|
|
20
|
-
date: 2011-
|
19
|
+
date: 2011-08-10 00:00:00 -04:00
|
21
20
|
default_executable:
|
22
21
|
dependencies:
|
23
22
|
- !ruby/object:Gem::Dependency
|
@@ -104,14 +103,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
104
|
none: false
|
106
105
|
requirements:
|
107
|
-
- - "
|
106
|
+
- - ">="
|
108
107
|
- !ruby/object:Gem::Version
|
109
|
-
hash:
|
108
|
+
hash: 3
|
110
109
|
segments:
|
111
|
-
-
|
112
|
-
|
113
|
-
- 1
|
114
|
-
version: 1.3.1
|
110
|
+
- 0
|
111
|
+
version: "0"
|
115
112
|
requirements: []
|
116
113
|
|
117
114
|
rubyforge_project: torquespec
|