ocean-rails 3.8.1 → 3.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ocean/api.rb +14 -4
- 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: 3bf3f4a3ed2f020535fd3ae4ab640d2ccf38b8dd
|
4
|
+
data.tar.gz: e60a238e5ea0f8ecb7637695e96e152f50cc3f69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8e439ce945b9e43802153825e69eb91cf4b5ea31c5d0eea0af103b02fad8201ce455f364030d891a4b690284f1ac25a86876fbd0b07d7fa8dfacf3806eb8f06
|
7
|
+
data.tar.gz: cce20bd75d95089771a74691365bc650ee44295f0cd93e2226cc48882d7b80bbc1790620ab98979f8e38a2a73f849702bd013fee78eb1f02a17722ff3a068bc7
|
data/lib/ocean/api.rb
CHANGED
@@ -503,7 +503,7 @@ class Api
|
|
503
503
|
end
|
504
504
|
|
505
505
|
|
506
|
-
def self.async_job_body(href=nil, method=:get,
|
506
|
+
def self.async_job_body(href=nil, method=:get, body: {},
|
507
507
|
credentials: nil,
|
508
508
|
token: nil,
|
509
509
|
steps: nil,
|
@@ -512,9 +512,18 @@ class Api
|
|
512
512
|
max_seconds_in_queue: nil,
|
513
513
|
poison_email: nil)
|
514
514
|
h = {}
|
515
|
-
steps
|
516
|
-
|
517
|
-
|
515
|
+
unless steps
|
516
|
+
method = method && method.to_s.upcase
|
517
|
+
href = href && (href.first == "/" ? "#{INTERNAL_OCEAN_API_URL}#{href}" : Api.internalize_uri(href))
|
518
|
+
steps = if href && method
|
519
|
+
if ["POST","PUT"].include? method
|
520
|
+
[{"url" => href, "method" => method, "body" => body}]
|
521
|
+
else
|
522
|
+
[{"url" => href, "method" => method}]
|
523
|
+
end
|
524
|
+
end
|
525
|
+
steps ||= []
|
526
|
+
end
|
518
527
|
h['steps'] = steps
|
519
528
|
h['credentials'] = credentials || Api.credentials
|
520
529
|
h['token'] = token || Api.service_token
|
@@ -524,4 +533,5 @@ class Api
|
|
524
533
|
h['poison_email'] = poison_email if poison_email
|
525
534
|
h
|
526
535
|
end
|
536
|
+
|
527
537
|
end
|
data/lib/ocean/version.rb
CHANGED