packagecloud-ruby 0.2.19 → 0.2.22

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: 7d5b9cfbb4fa58fd4513b51b77128a5f79b09cec
4
- data.tar.gz: 79c30b70c7404f03a2162def26a4c7de879e5ba0
3
+ metadata.gz: 5d6df1597844084334f7991d65799802672be0e8
4
+ data.tar.gz: e7803cbe3239ab5633f2825b5adbd511c16013d5
5
5
  SHA512:
6
- metadata.gz: ed77f5de56f89489e43296cfbf581bcb9abb713d4020403494a5db9f4931b01e96d7650b14ebb44bdafb7c9ff4051f7b659694a55905c7dfbf07a6da7dfc433a
7
- data.tar.gz: 759d2175cb37074adf17231af1cfd198f6af203420a57fcdb25771a894e39d2073dff0dbc0a295366354c4a71c2c187305d24b3ea5bb6a51066695491256359c
6
+ metadata.gz: adcd8e0065313f4f56b261245112fd2feb5a7f5fbd206374517f74a32708afda899b6a77bea18883924dda20a051b91412192c487b9ff17d0b072007288daec9
7
+ data.tar.gz: b0e7b9d97351739c69f028aa41f9f6094fdaf8b43445c40f7e2602031a371a11018e8bcadfb5891aa982bde837736becf7246c5918bf098b46be95ead81e9603
data/README.md CHANGED
@@ -111,7 +111,7 @@ go to your [Account Settings](https://packagecloud.io/api_token) to see your API
111
111
  distro_id = @client.find_distribution_id("ubuntu/trusty")
112
112
  source_files = { "jake_1.0.orig.tar.bz2" => open("/path/jake_1.0.orig.tar.bz2"),
113
113
  "jake_1.0-7.debian.tar.gz" => open("/path/jake_1.0-7.debian.tar.gz") }
114
- dsc_package = Packagecloud::Package.new("jake_1.0-7.dsc", distro_id, source_files)
114
+ dsc_package = Packagecloud::Package.new(open("jake_1.0-7.dsc"), distro_id, source_files)
115
115
 
116
116
  # Upload Packages
117
117
  @client.put_package("test_repo", gem_package)
@@ -1,4 +1,4 @@
1
- require 'json/pure'
1
+ require 'json/pure' unless JSON::Ext
2
2
  require 'mime'
3
3
  require 'excon'
4
4
  require 'packagecloud/result'
@@ -103,6 +103,19 @@ module Packagecloud
103
103
  parsed_json_result(response)
104
104
  end
105
105
 
106
+ def list_packages(repo)
107
+ assert_valid_repo_name(repo)
108
+ response = get("/api/v1/repos/#{username}/#{repo}/packages.json")
109
+ parsed_json_result(response)
110
+ end
111
+
112
+ def delete_package(repo, distro, distro_release, package_filename)
113
+ assert_valid_repo_name(repo)
114
+ url = "/api/v1/repos/#{username}/#{repo}/#{distro}/#{distro_release}/#{package_filename}"
115
+ response = delete(url)
116
+ parsed_json_result(response)
117
+ end
118
+
106
119
  def put_package(repo, package)
107
120
  assert_valid_repo_name(repo)
108
121
 
@@ -147,6 +160,13 @@ module Packagecloud
147
160
  end
148
161
  end
149
162
 
163
+ def create_read_tokens(repo, master_token_id, read_token_name)
164
+ assert_valid_repo_name(repo)
165
+ url = "/api/v1/repos/#{username}/#{repo}/master_tokens/#{master_token_id}/read_tokens.json"
166
+ response = post(url, "read_token[name]=#{read_token_name}", "application/x-www-form-urlencoded")
167
+ parsed_json_result(response)
168
+ end
169
+
150
170
  private
151
171
  def assert_valid_repo_name(repo)
152
172
  if repo.include?("/")
@@ -212,6 +232,10 @@ module Packagecloud
212
232
  request(url, :get)
213
233
  end
214
234
 
235
+ def delete(url)
236
+ request(url, 'DELETE')
237
+ end
238
+
215
239
  def username
216
240
  self.credentials.username
217
241
  end
@@ -1,7 +1,7 @@
1
1
  module Packagecloud
2
2
  MAJOR_VERSION = "0"
3
3
  MINOR_VERSION = "2"
4
- PATCH_VERSION = "19"
4
+ PATCH_VERSION = "22"
5
5
 
6
6
  VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join(".")
7
7
  end
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: 0.2.19
4
+ version: 0.2.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Damato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon