ocean-rails 4.0.0 → 4.0.1

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: 2680dfb63919db3bb5b39740682bb6bb5c2714b7
4
- data.tar.gz: 968ce1425b26201205c8972b35286c611a89566d
3
+ metadata.gz: 97f9a34ca65d7137708b075d4e52e8f5c44ce096
4
+ data.tar.gz: c5782aa737668936d7d8f4fe222b498292f20437
5
5
  SHA512:
6
- metadata.gz: d66569c6c23db6e252a9ce5c0a30ccba12658cca50a27422e18e2802f6e1e63c5cada7f4f96265466b51ebdbbdad9b6cff71eae9e33da94ec446ff322c0eb7dc
7
- data.tar.gz: bbb575ba4514f23dcfe627fcb8fad0fb0336590bb40f251444519acadea8dc15e03a8d57d06256bf4679294a0946eab2c3eea837479165e25ba87b847ef687f1
6
+ metadata.gz: fb662d2693c0aa5594ae84507e06e96b469b64cb86373448637f58563491a4d2a58735a492c116c28a240c9eaa8c4247aa52a52ff002924f6b2576ebaca5348a
7
+ data.tar.gz: ce7566987e78b3267327602beda61000c6d64edc7180f6b8a77dfb7a3b59633c17ae0ff1c7d73b69080a45193ee6cb3851053083a10a093a9f157105e4a899d5
data/lib/ocean/api.rb CHANGED
@@ -182,8 +182,7 @@ class Api
182
182
  headers['X-API-Token'] = x_api_token if x_api_token.present?
183
183
  headers['X-Metadata'] = x_metadata if x_metadata.present?
184
184
 
185
- tries_done = 0
186
- max_tries = [:get, "GET", "get"].include?(http_method) ? retries + 1 : 1
185
+ retries = 0 unless http_method.to_s.upcase == "GET"
187
186
 
188
187
  @hydra ||= Typhoeus::Hydra.hydra
189
188
  request = nil # For clarity
@@ -282,75 +281,9 @@ class Api
282
281
  end
283
282
 
284
283
 
285
- # http://liufengyun.chaos-lab.com/prog/2013/10/23/continuation-in-ruby.html
286
- # http://gnuu.org/2009/03/21/demystifying-continuations-in-ruby/
287
- # http://www.ruby-doc.org/core-2.1.3/Continuation.html
288
-
289
-
290
284
  class TimeoutError < StandardError; end
291
285
  class NoResponseError < StandardError; end
292
286
 
293
- # #
294
- # # Makes an internal HTTP request to +host_url+ using the HTTP method +method+. The +resource_name+
295
- # # is used to obtain the latest version string of the resource. The arg +path+ is the
296
- # # local path, +args+ is a hash of query args, and +headers+ a hash of extra HTTP headers.
297
- # #
298
- # # Returns the response in its entirety so that the caller can examine its status and body.
299
- # #
300
- # # It is quite probable that this method will become deprecated. The main reason for its existence
301
- # # is the version computation, nothing more, and separating host and path isn't ideal.
302
- # #
303
- # def self.call(host_url, http_method, resource_name, path, args=nil, headers={})
304
- # if [:post, :put].include? http_method
305
- # request "#{host_url}/#{version_for resource_name}#{path}", http_method,
306
- # headers: headers, body: args
307
- # else
308
- # request "#{host_url}/#{version_for resource_name}#{path}", http_method,
309
- # headers: headers, args: args
310
- # end
311
- # end
312
-
313
-
314
- # #
315
- # # Convenience method to make an internal +GET+ request to the Ocean Api. The +resource_name+
316
- # # is used to obtain the latest version string of the resource. The arg +path+ is the
317
- # # local path, +args+ is a hash of query args, and +headers+ a hash of extra HTTP headers.
318
- # #
319
- # # Returns the response in its entirety so that the caller can examine its status and body.
320
- # #
321
- # #
322
- # def self.get(*args) call(INTERNAL_OCEAN_API_URL, :get, *args); end
323
-
324
- # #
325
- # # Convenience method to make an internal +POST+ request to the Ocean Api. The +resource_name+
326
- # # is used to obtain the latest version string of the resource. The arg +path+ is the
327
- # # local path, +args+ is a hash of query args, and +headers+ a hash of extra HTTP headers.
328
- # #
329
- # # Returns the response in its entirety so that the caller can examine its status and body.
330
- # #
331
- # #
332
- # def self.post(*args) call(INTERNAL_OCEAN_API_URL, :post, *args); end
333
-
334
- # #
335
- # # Convenience method to make an internal +PUT+ request to the Ocean Api. The +resource_name+
336
- # # is used to obtain the latest version string of the resource. The arg +path+ is the
337
- # # local path, +args+ is a hash of query args, and +headers+ a hash of extra HTTP headers.
338
- # #
339
- # # Returns the response in its entirety so that the caller can examine its status and body.
340
- # #
341
- # #
342
- # def self.put(*args) call(INTERNAL_OCEAN_API_URL, :put, *args); end
343
-
344
- # #
345
- # # Convenience method to make an internal +DELETE+ request to the Ocean Api. The +resource_name+
346
- # # is used to obtain the latest version string of the resource. The arg +path+ is the
347
- # # local path, +args+ is a hash of query args, and +headers+ a hash of extra HTTP headers.
348
- # #
349
- # # Returns the response in its entirety so that the caller can examine its status and body.
350
- # #
351
- # #
352
- # def self.delete(*args) call(INTERNAL_OCEAN_API_URL, :delete, *args); end
353
-
354
287
 
355
288
  #
356
289
  # Makes an internal +PURGE+ call to all Varnish instances. The call is made in parallel.
data/lib/ocean/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "4.0.0"
2
+ VERSION = "4.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson