bits_service_client 2.0.0.pre.1 → 2.0.1.pre.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: fdfa2fa5067f15c29f8b4c76ab9acf3c483615bb
4
- data.tar.gz: bc04fd40537a4e4fb93d46aa9ceab36c98b3aee2
3
+ metadata.gz: c0df9c486bd6f1057d9c710d8f0d9e058fac0f3b
4
+ data.tar.gz: 897fe68dcd77b63c26e43f8f793b567c40f8484b
5
5
  SHA512:
6
- metadata.gz: a74e284649cddb7723e944d7bf5912818b72db734f724b5b95b0885a49b137b1e20df7f4893a220c4b5a6e6a4eb78c509869a675b66210f5f8cf0dea406eca76
7
- data.tar.gz: 5e4bdf88df7c5e649fbfbeda92e1e17f3f09c8125af04df96cdce4f5e7d21d3389a86461932d8f75c86bcf15982e7a90e2cff629fd4e3ddc03fb674b1be3b01f
6
+ metadata.gz: 70c6a2dd2d73f591bbbd73876efdae68ea933e2da1e77fc3da7ca1ee7c36a15b82749d9efa7ac850465c355b345164bf228ab4686053c8a0cd898d3f73f7527c
7
+ data.tar.gz: e802d5af22bc59697bf7399d254c9b3c28b6e6e21d4bab32ec56506b9d3d6fec5c0341513073a0ed3d9bae24ef310acfcbc12ae8f9833f52a0891b061b15feac
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module BitsService
3
4
  class ResourcePool
4
5
  def initialize(endpoint:, request_timeout_in_seconds:, vcap_request_id: '', ca_cert_path: nil)
@@ -16,13 +17,19 @@ module BitsService
16
17
  end
17
18
 
18
19
  def bundles(resources_json, entries_path)
19
- validate_file! entries_path
20
- body = {
21
- resources: UploadIO.new(StringIO.new(resources_json),'application/json', 'resources.json'),
22
- application: UploadIO.new(entries_path, 'application/octet-stream', 'entries.zip')
23
- }
24
- multipart_post('/app_stash/bundles', body, @vcap_request_id).tap do |response|
25
- validate_response_code!(200, response)
20
+ if entries_path.to_s == ''
21
+ post('/app_stash/bundles', resources_json, @vcap_request_id).tap do |response|
22
+ validate_response_code!(200, response)
23
+ end
24
+ else
25
+ validate_file! entries_path
26
+ body = {
27
+ resources: UploadIO.new(StringIO.new(resources_json), 'application/json', 'resources.json'),
28
+ application: UploadIO.new(entries_path, 'application/octet-stream', 'entries.zip')
29
+ }
30
+ multipart_post('/app_stash/bundles', body, @vcap_request_id).tap do |response|
31
+ validate_response_code!(200, response)
32
+ end
26
33
  end
27
34
  end
28
35
 
@@ -67,7 +74,7 @@ module BitsService
67
74
  path: request.path,
68
75
  address: http_client.address,
69
76
  port: http_client.port,
70
- vcap_request_id: vcap_request_id,
77
+ vcap_request_id: vcap_request_id
71
78
  })
72
79
 
73
80
  request.add_field('X-VCAP-REQUEST-ID', vcap_request_id)
@@ -75,7 +82,7 @@ module BitsService
75
82
  http_client.request(request).tap do |response|
76
83
  @logger.info('Response', {
77
84
  code: response.code,
78
- vcap_request_id: vcap_request_id,
85
+ vcap_request_id: vcap_request_id
79
86
  })
80
87
  end
81
88
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module BitsServiceClient
3
- VERSION = '2.0.0.pre.1'
4
+ VERSION = '2.0.1.pre.1'
4
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bits_service_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.1
4
+ version: 2.0.1.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rizwan Reza
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-05-22 00:00:00.000000000 Z
14
+ date: 2018-05-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport