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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76a29b277f47baf8fb8b49880ed74957a27a3272
4
- data.tar.gz: cf0deea08ce6253918497921c6f74eecdb86809a
3
+ metadata.gz: 3350600e9eb0c61a630d3ea85419cb2b8051fc9c
4
+ data.tar.gz: 8cba84fcb1050da9caff1ad8155ba5fca2b43cc9
5
5
  SHA512:
6
- metadata.gz: 4070e75f2028955918127abace8a977fe23a028078f41ee31c158f5f57a772df88665676f50841f86c3bf9fd9a5b114dd79391677cab1a02c9b9ff0a4d129939
7
- data.tar.gz: 390b6fc9bc0b615d7dcc90cd0fb77ba335a01e544076bad037f88c3bf74dd1c569c4dd24b636b6292eb28330d511db84935c2a68a65f9b4f3cb8a7c52e2bbfe5
6
+ metadata.gz: f244f5d9a7fb8c9d43e378cb7b0d69714930488c3601d953d3df938bf2284fdfb67a6dc2cdce0ca9d0c2cef3472f7917600f2c6f9a0cbf821a0a03bc0a8dfed8
7
+ data.tar.gz: 65bdec7b34bc34aa14e17089631f9bf47a3c352294b7dc2fb856a2ce4639395f3578f5b52d8602dba7ce5a5a65bd3b0ac79ac124b0c3c7ce2635d8831644f4ae
data/lib/cistern/hash.rb CHANGED
@@ -11,7 +11,7 @@ class Cistern::Hash
11
11
 
12
12
  # Replaces the hash without the given keys.
13
13
  def self.except!(hash, *keys)
14
- hash.keys.each { |key| hash.delete(key) }
14
+ keys.each { |key| hash.delete(key) }
15
15
  hash
16
16
  end
17
17
 
@@ -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).mock(*args)
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).real(*args)
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
@@ -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={})
@@ -1,3 +1,3 @@
1
1
  module Cistern
2
- VERSION = "1.0.1.pre4"
2
+ VERSION = "1.0.1.pre5"
3
3
  end
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.pre4
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-13 00:00:00.000000000 Z
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: