ocean-rails 4.0.0 → 4.0.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 +4 -4
- data/lib/ocean/api.rb +1 -68
- data/lib/ocean/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97f9a34ca65d7137708b075d4e52e8f5c44ce096
|
4
|
+
data.tar.gz: c5782aa737668936d7d8f4fe222b498292f20437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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