bits_service_client 0.3.2 → 2.0.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/lib/bits_service_client/client.rb +1 -1
- data/lib/bits_service_client/resource_pool.rb +9 -23
- data/lib/bits_service_client/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdfa2fa5067f15c29f8b4c76ab9acf3c483615bb
|
4
|
+
data.tar.gz: bc04fd40537a4e4fb93d46aa9ceab36c98b3aee2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a74e284649cddb7723e944d7bf5912818b72db734f724b5b95b0885a49b137b1e20df7f4893a220c4b5a6e6a4eb78c509869a675b66210f5f8cf0dea406eca76
|
7
|
+
data.tar.gz: 5e4bdf88df7c5e649fbfbeda92e1e17f3f09c8125af04df96cdce4f5e7d21d3389a86461932d8f75c86bcf15982e7a90e2cff629fd4e3ddc03fb674b1be3b01f
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.4.2
|
@@ -165,7 +165,7 @@ module BitsService
|
|
165
165
|
response: response
|
166
166
|
}.to_json
|
167
167
|
|
168
|
-
logger.error("UnexpectedResponseCode: expected '#{expected_codes}' got #{
|
168
|
+
logger.error("UnexpectedResponseCode: expected '#{expected_codes}' got #{response.code}")
|
169
169
|
|
170
170
|
fail BlobstoreError.new(error)
|
171
171
|
end
|
@@ -15,15 +15,13 @@ module BitsService
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
def bundles(resources_json)
|
26
|
-
post('/app_stash/bundles', resources_json, @vcap_request_id).tap do |response|
|
18
|
+
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|
|
27
25
|
validate_response_code!(200, response)
|
28
26
|
end
|
29
27
|
end
|
@@ -41,20 +39,11 @@ module BitsService
|
|
41
39
|
response: response
|
42
40
|
}.to_json
|
43
41
|
|
44
|
-
@logger.error("UnexpectedResponseCode: expected #{expected} got #{
|
42
|
+
@logger.error("UnexpectedResponseCode: expected #{expected} got #{response.code}")
|
45
43
|
|
46
44
|
fail Errors::UnexpectedResponseCode.new(error)
|
47
45
|
end
|
48
46
|
|
49
|
-
def with_file_attachment!(file_path, filename, &block)
|
50
|
-
validate_file! file_path
|
51
|
-
|
52
|
-
File.open(file_path) do |file|
|
53
|
-
attached_file = UploadIO.new(file, 'application/octet-stream', filename)
|
54
|
-
yield attached_file
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
47
|
def validate_file!(file_path)
|
59
48
|
return if File.exist?(file_path)
|
60
49
|
|
@@ -69,10 +58,7 @@ module BitsService
|
|
69
58
|
end
|
70
59
|
|
71
60
|
def multipart_post(path, body, vcap_request_id)
|
72
|
-
|
73
|
-
do_request(http_client, request, vcap_request_id).tap do |response|
|
74
|
-
validate_response_code!(201, response)
|
75
|
-
end
|
61
|
+
do_request(http_client, Net::HTTP::Post::Multipart.new(path, body), vcap_request_id)
|
76
62
|
end
|
77
63
|
|
78
64
|
def do_request(http_client, request, vcap_request_id)
|
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: 0.
|
4
|
+
version: 2.0.0.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-
|
14
|
+
date: 2018-05-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -166,6 +166,7 @@ files:
|
|
166
166
|
- ".gitignore"
|
167
167
|
- ".rspec"
|
168
168
|
- ".rubocop.yml"
|
169
|
+
- ".ruby-version"
|
169
170
|
- Gemfile
|
170
171
|
- Guardfile
|
171
172
|
- LICENSE
|
@@ -194,9 +195,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
195
|
version: '0'
|
195
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
197
|
requirements:
|
197
|
-
- - "
|
198
|
+
- - ">"
|
198
199
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
200
|
+
version: 1.3.1
|
200
201
|
requirements: []
|
201
202
|
rubyforge_project:
|
202
203
|
rubygems_version: 2.6.14.1
|