packagecloud-ruby 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/packagecloud/client.rb +1 -1
- data/lib/packagecloud/version.rb +1 -1
- data/spec/packagecloud_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2QwMjQ4NzA3NDdkZTA0OTZlZTFlMmE0OTcwMjExZWU3MzM2YjY2ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWEyYzg3MzdhMDA0NDQxYzE5MGQyM2ZjMDI3OThjYWMyOTcwNDY0Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmU4YWIyYWIxMDVmNjc5MWM2NzFmZTY1NjMxMTAwMjNlYTlmNDAwNTdmYzQ4
|
10
|
+
ZDc4Y2U4YTVjMTkwM2NmYjg2MTFmZTMxNTdiNTk2YzVjNTIzMjU5MmFkZGVh
|
11
|
+
YTAxNTdiYjg3ZDEwMDU1N2YwZTM1YzEzYjZiZWYxY2Q3Nzc2MDM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njk1Yjk5MGEyZWI4YzY1OGNmNWYzNDczZWEyYzBjNGYwYTIwYWQxNTc4MzNi
|
14
|
+
MzA2NTFhNGQ2NWEwZDJkNjFiZmVjZjE5NzY0YzExYWFmZWEyNzNkYThiMWVj
|
15
|
+
ODg2NjM5YjUyYTA4MTZjN2NlNGQxNzZkODYwN2I4NmMwMDY0MTk=
|
data/lib/packagecloud/client.rb
CHANGED
@@ -115,7 +115,7 @@ module Packagecloud
|
|
115
115
|
parsed_json_result(response)
|
116
116
|
end
|
117
117
|
|
118
|
-
def put_package(repo, package, distro_version_id)
|
118
|
+
def put_package(repo, package, distro_version_id=nil)
|
119
119
|
assert_valid_repo_name(repo)
|
120
120
|
|
121
121
|
url = "/api/v1/repos/#{username}/#{repo}/packages.json"
|
data/lib/packagecloud/version.rb
CHANGED
data/spec/packagecloud_spec.rb
CHANGED
@@ -57,6 +57,22 @@ describe Packagecloud do
|
|
57
57
|
expect($request.content_length > size).to be_truthy
|
58
58
|
end
|
59
59
|
|
60
|
+
it "POST gem package /api/v1/repos/joedamato/test_repo/packages.json" do
|
61
|
+
path = "spec/fixtures/chewbacca-1.0.0.gem"
|
62
|
+
size = File.size(path)
|
63
|
+
package = Package.new(:file => path)
|
64
|
+
|
65
|
+
result = @client.put_package("test_repo", package)
|
66
|
+
expect(result.succeeded).to be_truthy
|
67
|
+
|
68
|
+
#assert content type is set correctly
|
69
|
+
expect($request.content_type).to include("boundary=")
|
70
|
+
expect($request.content_type).to include("multipart/form-data")
|
71
|
+
|
72
|
+
# assert body is at least bigger than fixture file
|
73
|
+
expect($request.content_length > size).to be_truthy
|
74
|
+
end
|
75
|
+
|
60
76
|
it "POST debian package /api/v1/repos/joedamato/test_repo/packages.json with string distro_version_id" do
|
61
77
|
allow(@client).to receive(:find_distribution_id).and_return(3)
|
62
78
|
path = "spec/fixtures/libampsharp2.0-cil_2.0.4-1_all.deb"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: packagecloud-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Damato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|