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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjcwOGRkNWM5YjU5OTM4ZGYxZDAxYWE3NTA0MDI2NWJjZGZlNzYzYg==
4
+ M2QwMjQ4NzA3NDdkZTA0OTZlZTFlMmE0OTcwMjExZWU3MzM2YjY2ZA==
5
5
  data.tar.gz: !binary |-
6
- ODNiZWMwMDRiOGY0MmJmNDUxMTIwNGI5ZmQyOGFiOGI2YzQzNmUzNA==
6
+ ZWEyYzg3MzdhMDA0NDQxYzE5MGQyM2ZjMDI3OThjYWMyOTcwNDY0Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDVlOWM3MDViMTJmNTZiMTRlMjg5NDc4NjUzYTVkN2VmMWIxYWNkZDVlYWEw
10
- NWYzNTJmZWU0YzQ2MGI3YTc1MTgzNGZmOGYzYjExMTdjMDM5ZWJhNmI2MmMy
11
- MWNhN2JjYjllYWY0NjNmNWYxNmYzNjVkYTg2OWJkZmVmZTI4Y2M=
9
+ YmU4YWIyYWIxMDVmNjc5MWM2NzFmZTY1NjMxMTAwMjNlYTlmNDAwNTdmYzQ4
10
+ ZDc4Y2U4YTVjMTkwM2NmYjg2MTFmZTMxNTdiNTk2YzVjNTIzMjU5MmFkZGVh
11
+ YTAxNTdiYjg3ZDEwMDU1N2YwZTM1YzEzYjZiZWYxY2Q3Nzc2MDM=
12
12
  data.tar.gz: !binary |-
13
- ZTVkMzQzYTVjMGY0YWM1ODMzMTRhNTNlMDcyNTFlMTUyYTJhZWMxYWY2NGE3
14
- Y2VmNjEyNTUxNzdkMThiZWFlY2IxZDIwMjk5ZDlkYzA0YzI3M2RlMjMwZTY2
15
- NDYzOTRiOWEwZWYwZDFhMTc2NGRjMTQ2MGU2YmRhYWRmZmNlYWM=
13
+ Njk1Yjk5MGEyZWI4YzY1OGNmNWYzNDczZWEyYzBjNGYwYTIwYWQxNTc4MzNi
14
+ MzA2NTFhNGQ2NWEwZDJkNjFiZmVjZjE5NzY0YzExYWFmZWEyNzNkYThiMWVj
15
+ ODg2NjM5YjUyYTA4MTZjN2NlNGQxNzZkODYwN2I4NmMwMDY0MTk=
@@ -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"
@@ -1,7 +1,7 @@
1
1
  module Packagecloud
2
2
  MAJOR_VERSION = "1"
3
3
  MINOR_VERSION = "0"
4
- PATCH_VERSION = "1"
4
+ PATCH_VERSION = "2"
5
5
 
6
6
  VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join(".")
7
7
  end
@@ -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.1
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-08 00:00:00.000000000 Z
11
+ date: 2016-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon