cistern 1.0.1.pre4 → 1.0.1.pre5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cistern/hash.rb +1 -1
- data/lib/cistern/request.rb +4 -2
- data/lib/cistern/service.rb +13 -3
- data/lib/cistern/version.rb +1 -1
- 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: 3350600e9eb0c61a630d3ea85419cb2b8051fc9c
|
4
|
+
data.tar.gz: 8cba84fcb1050da9caff1ad8155ba5fca2b43cc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f244f5d9a7fb8c9d43e378cb7b0d69714930488c3601d953d3df938bf2284fdfb67a6dc2cdce0ca9d0c2cef3472f7917600f2c6f9a0cbf821a0a03bc0a8dfed8
|
7
|
+
data.tar.gz: 65bdec7b34bc34aa14e17089631f9bf47a3c352294b7dc2fb856a2ce4639395f3578f5b52d8602dba7ce5a5a65bd3b0ac79ac124b0c3c7ce2635d8831644f4ae
|
data/lib/cistern/hash.rb
CHANGED
data/lib/cistern/request.rb
CHANGED
@@ -4,15 +4,17 @@ module Cistern::Request
|
|
4
4
|
|
5
5
|
service::Mock.module_eval <<-EOS, __FILE__, __LINE__
|
6
6
|
def #{request}(*args)
|
7
|
-
#{klass}.new(self).
|
7
|
+
#{klass}.new(self)._mock(*args)
|
8
8
|
end
|
9
9
|
EOS
|
10
10
|
|
11
11
|
service::Real.module_eval <<-EOS, __FILE__, __LINE__
|
12
12
|
def #{request}(*args)
|
13
|
-
#{klass}.new(self).
|
13
|
+
#{klass}.new(self)._real(*args)
|
14
14
|
end
|
15
15
|
EOS
|
16
|
+
|
17
|
+
request
|
16
18
|
end
|
17
19
|
|
18
20
|
attr_reader :service
|
data/lib/cistern/service.rb
CHANGED
@@ -73,12 +73,22 @@ class Cistern::Service
|
|
73
73
|
def self.inherited(klass)
|
74
74
|
klass.extend(Cistern::Request::ClassMethods)
|
75
75
|
|
76
|
-
Cistern::Request.service_request(service, klass)
|
76
|
+
name = Cistern::Request.service_request(service, klass)
|
77
|
+
|
78
|
+
service.requests[name.to_sym] = klass
|
77
79
|
end
|
78
80
|
|
79
81
|
def self.service
|
80
82
|
#{klass.name}
|
81
83
|
end
|
84
|
+
|
85
|
+
def _mock(*args)
|
86
|
+
mock(*args)
|
87
|
+
end
|
88
|
+
|
89
|
+
def _real(*args)
|
90
|
+
real(*args)
|
91
|
+
end
|
82
92
|
end
|
83
93
|
EOS
|
84
94
|
|
@@ -118,7 +128,7 @@ class Cistern::Service
|
|
118
128
|
end
|
119
129
|
|
120
130
|
def requests
|
121
|
-
@requests ||=
|
131
|
+
@requests ||= {}
|
122
132
|
end
|
123
133
|
|
124
134
|
def requires(*args)
|
@@ -130,7 +140,7 @@ class Cistern::Service
|
|
130
140
|
end
|
131
141
|
|
132
142
|
def mocked_requests
|
133
|
-
@mocked_requests ||=
|
143
|
+
@mocked_requests ||= {}
|
134
144
|
end
|
135
145
|
|
136
146
|
def validate_options(options={})
|
data/lib/cistern/version.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: 1.0.1.
|
4
|
+
version: 1.0.1.pre5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: API client framework extracted from Fog
|
14
14
|
email:
|