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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 873e769a4fcf4fd810900bc42dfdcea274f8e87e
4
- data.tar.gz: b32212e212bb48e7dc15f3f4745b92c44e96dbfa
3
+ metadata.gz: 3bf3f4a3ed2f020535fd3ae4ab640d2ccf38b8dd
4
+ data.tar.gz: e60a238e5ea0f8ecb7637695e96e152f50cc3f69
5
5
  SHA512:
6
- metadata.gz: 53de347a9e73f612e4bd5ce0658864f9f00e5c713147d4d4abb1320cf2540879b2af3773bb6b167a4b2b7577c1b7c10dc55cd9e99a9052688f4b2f7691520e58
7
- data.tar.gz: 12c492e6dfe700e29251b0bb60f0af3383ab5807827c96650098219656e9ec2028e3f44b3a19bc36eb1cdc8e1c9d7307bf2010c8ef6cba9999b10588b7d6ac52
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 ||= href && [{"url" => href.first == "/" ? "#{INTERNAL_OCEAN_API_URL}#{href}" : Api.internalize_uri(href),
516
- "method" => (method && method.to_s.upcase || "GET")}] ||
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
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "3.8.1"
2
+ VERSION = "3.8.2"
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: 3.8.1
4
+ version: 3.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson