vanilli-ruby 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b140a9f3a7f5fae44f912c444f6eac5013f77394
4
- data.tar.gz: 2ec907dfdbdc33ce2f4c92a8eb251eb497805db8
3
+ metadata.gz: 41c6d1fd4c2a3d2a7a556bae0b93fa2cf4c5a087
4
+ data.tar.gz: 3fb2c7bc730c90aa8a60edf5fcb2a16bd7db3970
5
5
  SHA512:
6
- metadata.gz: 1d5ca859de424ad96551b715ddb88fbf397ded39a68915355efdc8421833e1cd7774d67d0a4e34e377c83d62af1101beca0f7f17134719ce804db25816c341e1
7
- data.tar.gz: 86ff0b4e09d5af44ff54e57308037a0348509d7e1dc6e8c8b8320820c5bb213e9bf49d2473731c2a959987635646abc3a820d12aa8e464538dc6685578aefe5f
6
+ metadata.gz: 814f9a000b5b98dd1b8166fd6545d808a94cd3fef2e9f44b5aea3311f2ef1b136bd0a74a1c57102641349ecb00b2783139db0ce32091f7fab17910ac9f208bde
7
+ data.tar.gz: 8c8ea29fb01b774479d1795dc978840bdac02f74aba8770f05b1b159365d2b7d4571dbe80ec2e39b6f47f4ce0c6511417183136248f678e0b558c811ebe89767
@@ -39,6 +39,10 @@ end
39
39
  # "rubified" (i.e. snake-case for camel-case) version of the
40
40
  # default javascript API provided with vanilli.
41
41
  class VanilliClient
42
+ def initialize(port)
43
+ @port = port
44
+ end
45
+
42
46
  # Represents a single stub as will be registered with
43
47
  # the vanilli server.
44
48
  class Stub
@@ -131,7 +135,7 @@ class VanilliClient
131
135
  def stub(*stubs)
132
136
  stubs.each do |stub|
133
137
  begin
134
- RestClient.post 'http://localhost:9000/_vanilli/stubs', stub.to_json, content_type: :json, accept: :json
138
+ RestClient.post "http://localhost:#{@port}/_vanilli/stubs", stub.to_json, content_type: :json, accept: :json
135
139
  rescue => e
136
140
  raise e.response
137
141
  end
@@ -147,7 +151,7 @@ class VanilliClient
147
151
 
148
152
  # Clears the vanilli server of all stubs.
149
153
  def clear
150
- RestClient.delete 'http://localhost:9000/_vanilli/stubs'
154
+ RestClient.delete "http://localhost:#{@port}/_vanilli/stubs"
151
155
  rescue => e
152
156
  raise e.response
153
157
  end
@@ -156,7 +160,7 @@ class VanilliClient
156
160
  # not, an error is thrown.
157
161
  def verify
158
162
  begin
159
- res = JSON.parse(RestClient.get 'http://localhost:9000/_vanilli/verify')
163
+ res = JSON.parse(RestClient.get "http://localhost:#{@port}/_vanilli/verify")
160
164
  rescue => e
161
165
  raise e.response
162
166
  end
@@ -167,7 +171,7 @@ class VanilliClient
167
171
  # Pulls back details of all requests that were logged against the
168
172
  # specified capture id.
169
173
  def get_captures(capture_id)
170
- JSON.parse(RestClient.get 'http://localhost:9000/_vanilli/captures/' + capture_id)
174
+ JSON.parse(RestClient.get "http://localhost:#{@port}/_vanilli/captures/#{capture_id}")
171
175
  rescue => e
172
176
  raise e.response
173
177
  end
@@ -183,7 +187,7 @@ class VanilliClient
183
187
  # not, an error is thrown.
184
188
  def dump
185
189
  begin
186
- puts RestClient.get('http://localhost:9000/_vanilli/dump')
190
+ puts RestClient.get("http://localhost:#{@port}/_vanilli/dump")
187
191
  rescue => e
188
192
  raise e.response
189
193
  end
data/vanilli-ruby.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "vanilli-ruby"
7
- spec.version = "1.1.0"
7
+ spec.version = "1.1.1"
8
8
  spec.authors = ["Alistair Dutton"]
9
9
  spec.email = ["kelveden@gmail.com"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanilli-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alistair Dutton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-16 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler