cistern 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cistern/service.rb +14 -6
- data/lib/cistern/version.rb +1 -1
- data/lib/cistern/wait_for.rb +23 -9
- data/lib/cistern.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9db40e93bb01c7cf0fd8c04ae34fc87d1c90ec7a
|
4
|
+
data.tar.gz: bc3dce9fd3632ee078fe99e716ab8af79a26a7ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae821dfb3d91a24edb3e268c7647df00a24e6aa5628592ed311ab97fa3ea90808cc777de0cb98adabcf3dd86bc6e13e8fd2a4e107db55d68868cfae198455cc8
|
7
|
+
data.tar.gz: 90a80c9f6ed3a56fe979b9304ec3a82843d0b1984d0bff9bfc6ed9a3b4f1c708a01c78ef2b2f00f02f2f3f46e6e3c061b1c4e8a3615ca614da343a0fda5f44e3
|
data/lib/cistern/service.rb
CHANGED
@@ -32,9 +32,22 @@ class Cistern::Service
|
|
32
32
|
def self.service
|
33
33
|
#{klass.name}
|
34
34
|
end
|
35
|
+
|
36
|
+
class Real
|
37
|
+
end
|
38
|
+
|
39
|
+
class Mock
|
40
|
+
end
|
35
41
|
EOS
|
36
42
|
|
37
43
|
klass.send(:const_set, :Timeout, Class.new(Cistern::Error))
|
44
|
+
|
45
|
+
klass::Mock.send(:include, klass::Collections)
|
46
|
+
klass::Mock.send(:extend, Cistern::WaitFor)
|
47
|
+
klass::Mock.timeout_error = klass::Timeout
|
48
|
+
klass::Real.send(:include, klass::Collections)
|
49
|
+
klass::Real.send(:extend, Cistern::WaitFor)
|
50
|
+
klass::Real.timeout_error = klass::Timeout
|
38
51
|
end
|
39
52
|
|
40
53
|
def collection_path(collection_path)
|
@@ -154,12 +167,7 @@ class Cistern::Service
|
|
154
167
|
validate_options(options)
|
155
168
|
setup_requirements
|
156
169
|
|
157
|
-
|
158
|
-
|
159
|
-
klass.send(:include, service::Collections)
|
160
|
-
klass.send(:extend, Cistern::WaitFor)
|
161
|
-
klass.timeout_error = service::Timeout
|
162
|
-
klass.new(options)
|
170
|
+
self.const_get(self.mocking? ? :Mock : :Real).new(options)
|
163
171
|
end
|
164
172
|
|
165
173
|
def reset!
|
data/lib/cistern/version.rb
CHANGED
data/lib/cistern/wait_for.rb
CHANGED
@@ -2,15 +2,29 @@ require 'timeout'
|
|
2
2
|
|
3
3
|
module Cistern
|
4
4
|
module WaitFor
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
def timeout=(timeout)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
def
|
5
|
+
def timeout
|
6
|
+
@timeout || Cistern.timeout
|
7
|
+
end
|
8
|
+
|
9
|
+
def timeout=(timeout)
|
10
|
+
@timeout = timeout
|
11
|
+
end
|
12
|
+
|
13
|
+
def poll_interval
|
14
|
+
@poll_interval || Cistern.poll_interval
|
15
|
+
end
|
16
|
+
|
17
|
+
def poll_interval=(poll_interval)
|
18
|
+
@poll_interval = poll_interval
|
19
|
+
end
|
20
|
+
|
21
|
+
def timeout_error=(timeout_error)
|
22
|
+
@timeout_error = timeout_error
|
23
|
+
end
|
24
|
+
|
25
|
+
def timeout_error
|
26
|
+
@timeout_error || self.const_defined?(:Timeout) && self.const_get(:Timeout) || ::Timeout::Error
|
27
|
+
end
|
14
28
|
|
15
29
|
def wait_for(timeout = self.timeout, interval = self.poll_interval, &block)
|
16
30
|
duration = 0
|
data/lib/cistern.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cistern
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: API client framework extracted from Fog
|
14
14
|
email:
|