dpl-releases 1.10.2.travis.2979.6 → 1.10.2.travis.2987.6

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
  SHA256:
3
- metadata.gz: f95fdcc296b216b418617a0c302b1ef6650e3c64020202e73bd4c0906e484489
4
- data.tar.gz: 6ac4a45fdf59e04c6bfb59996ba3affb15b6be553b57577f6d76aec1a7f35e45
3
+ metadata.gz: 745b63e7e5778453396bd778b8a34cbb110514bf833ceac6739ea30e448678d2
4
+ data.tar.gz: e9889f276ac693997b57d8955ca26f2cbfd48b270a677324ab5d6f279ca98e3d
5
5
  SHA512:
6
- metadata.gz: 0a6befafd3936fb49cbcbcf52d3b71f28488d2a503fe6664f7e25faf4e1e5b839cd9e4e65cb6842749c797007f427aca5dd3b0be43567f1c761bf33c09aa4050
7
- data.tar.gz: 4e3c78ea4ab1124a73096bb2b9975754e6942a3c299f3d70102639a874a1e5bcd62208ab2afe65b647a78bb49833c3987d35ab25323f10522dce25ce4049722c
6
+ metadata.gz: 7fdf3931bd43fb97b99abc0de981cf764a53dad153c043d82adc8a89b59bd7ea846257cfa5c811182a96eee035c7cb61ab5019fca20053b149a017faff8daf2b
7
+ data.tar.gz: e3aae922ad30007712b682c7ef0356d0c433329fa027880fa486e49641d791d48e6eeb947b78a53bb538de68bcd13efc2de1151f71c2492bb746e6d034c83698
@@ -36,9 +36,9 @@ module DPL
36
36
  }
37
37
  }
38
38
  if options[:user] and options[:password]
39
- @api ||= Octokit::Client.new(:login => options[:user], :password => options[:password], :connection_options => connection_options)
39
+ @api ||= Octokit::Client.new(:login => options[:user], :password => options[:password], :auto_paginate => true, :connection_options => connection_options)
40
40
  else
41
- @api ||= Octokit::Client.new(:access_token => option(:api_key), :connection_options => connection_options)
41
+ @api ||= Octokit::Client.new(:access_token => option(:api_key), :auto_paginate => true, :connection_options => connection_options)
42
42
  end
43
43
  end
44
44
 
@@ -116,7 +116,7 @@ module DPL
116
116
  next unless File.file?(file)
117
117
  existing_url = nil
118
118
  filename = Pathname.new(file).basename.to_s
119
- api.release(release_url).rels[:assets].get.data.each do |existing_file|
119
+ api.release_assets(release_url).each do |existing_file|
120
120
  if existing_file.name == filename
121
121
  existing_url = existing_file.url
122
122
  end
@@ -30,7 +30,7 @@ describe DPL::Provider::Releases do
30
30
  describe "#api" do
31
31
  example "With API key" do
32
32
  api = double(:api)
33
- expect(::Octokit::Client).to receive(:new).with(:access_token => '0123445789qwertyuiop0123445789qwertyuiop', :connection_options=>{:request=>{:timeout=>180, :open_timeout=>180}}).and_return(api)
33
+ expect(::Octokit::Client).to receive(:new).with(:access_token => '0123445789qwertyuiop0123445789qwertyuiop', :auto_paginate => true, :connection_options=>{:request=>{:timeout=>180, :open_timeout=>180}}).and_return(api)
34
34
  expect(provider.api).to eq(api)
35
35
  end
36
36
 
@@ -39,7 +39,7 @@ describe DPL::Provider::Releases do
39
39
  provider.options.update(:user => 'foo')
40
40
  provider.options.update(:password => 'bar')
41
41
 
42
- expect(::Octokit::Client).to receive(:new).with(:login => 'foo', :password => 'bar', :connection_options=>{:request=>{:timeout=>180, :open_timeout=>180}}).and_return(api)
42
+ expect(::Octokit::Client).to receive(:new).with(:login => 'foo', :password => 'bar', :auto_paginate => true, :connection_options=>{:request=>{:timeout=>180, :open_timeout=>180}}).and_return(api)
43
43
  expect(provider.api).to eq(api)
44
44
  end
45
45
  end
@@ -169,10 +169,7 @@ describe DPL::Provider::Releases do
169
169
  allow(release.rels[:self]).to receive(:href)
170
170
  end
171
171
 
172
- allow(provider.api).to receive(:release)
173
- allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
174
- allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => [""]})
175
- allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])
172
+ allow(provider.api).to receive(:release_assets).and_return([])
176
173
 
177
174
  expect(provider.api).to receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>"application/octet-stream"})
178
175
  expect(provider.api).to receive(:upload_asset).with(anything, "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"})
@@ -197,10 +194,7 @@ describe DPL::Provider::Releases do
197
194
  allow(release.rels[:self]).to receive(:href)
198
195
  end
199
196
 
200
- allow(provider.api).to receive(:release)
201
- allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
202
- allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => [""]})
203
- allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([double(:name => "foo.bar", :url => 'foo-bar-url'), double(:name => "foo.foo", :url => 'foo-foo-url')])
197
+ allow(provider.api).to receive(:release_assets).and_return([double(:name => "foo.bar", :url => 'foo-bar-url'), double(:name => "foo.foo", :url => 'foo-foo-url')])
204
198
 
205
199
  expect(provider.api).to receive(:upload_asset).with(anything, "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"})
206
200
  expect(provider).to receive(:log).with("foo.bar already exists, skipping.")
@@ -225,10 +219,7 @@ describe DPL::Provider::Releases do
225
219
  allow(release.rels[:self]).to receive(:href)
226
220
  end
227
221
 
228
- allow(provider.api).to receive(:release)
229
- allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
230
- allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => [""]})
231
- allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([double(:name => "exists.txt", :url => "release-url")])
222
+ allow(provider.api).to receive(:release_assets).and_return([double(:name => "exists.txt", :url => "release-url")])
232
223
 
233
224
  expect(provider.api).to receive(:delete_release_asset).with("release-url").and_return(true)
234
225
  expect(provider.api).to receive(:upload_asset).with(anything, "exists.txt", {:name=>"exists.txt", :content_type=>"text/plain"})
@@ -256,10 +247,7 @@ describe DPL::Provider::Releases do
256
247
  allow(provider.api.create_release).to receive(:rels).and_return({:self => nil})
257
248
  allow(provider.api.create_release.rels[:slef]).to receive(:href)
258
249
 
259
- allow(provider.api).to receive(:release)
260
- allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
261
- allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => nil})
262
- allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])
250
+ allow(provider.api).to receive(:release_assets).and_return([])
263
251
 
264
252
  expect(provider.api).to receive(:upload_asset).with(anything, "test/foo.bar", {:name=>"foo.bar", :content_type=>"application/octet-stream"})
265
253
  expect(provider.api).to receive(:upload_asset).with(anything, "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"})
@@ -277,10 +265,7 @@ describe DPL::Provider::Releases do
277
265
  allow(provider).to receive(:slug).and_return("foo/bar")
278
266
  expect(File).to receive(:file?).with("bar.txt").and_return(true)
279
267
 
280
- allow(provider.api).to receive(:release)
281
- allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
282
- allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => nil})
283
- allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])
268
+ allow(provider.api).to receive(:release_assets).and_return([])
284
269
 
285
270
  expect(provider.api).to receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"})
286
271
  expect(provider.api).to receive(:update_release).with(anything, hash_including(:draft => false))
@@ -297,10 +282,7 @@ describe DPL::Provider::Releases do
297
282
  allow(provider).to receive(:slug).and_return("foo/bar")
298
283
  expect(File).to receive(:file?).with("bar.txt").and_return(true)
299
284
 
300
- allow(provider.api).to receive(:release)
301
- allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
302
- allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => nil})
303
- allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])
285
+ allow(provider.api).to receive(:release_assets).and_return([])
304
286
 
305
287
  expect(provider.api).to receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"})
306
288
  expect(provider.api).to receive(:update_release).with(anything, hash_including(:draft => true))
@@ -317,10 +299,7 @@ describe DPL::Provider::Releases do
317
299
  allow(provider).to receive(:slug).and_return("foo/bar")
318
300
  expect(File).to receive(:file?).with("bar.txt").and_return(true)
319
301
 
320
- allow(provider.api).to receive(:release)
321
- allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
322
- allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => nil})
323
- allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])
302
+ allow(provider.api).to receive(:release_assets).and_return([])
324
303
 
325
304
  expect(provider.api).to receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"})
326
305
  expect(provider.api).to receive(:update_release).with(anything, hash_including(:prerelease => true))
@@ -338,10 +317,7 @@ describe DPL::Provider::Releases do
338
317
  allow(provider).to receive(:slug).and_return("foo/bar")
339
318
  expect(File).to receive(:file?).with("bar.txt").and_return(true)
340
319
 
341
- allow(provider.api).to receive(:release)
342
- allow(provider.api.release).to receive(:rels).and_return({:assets => nil})
343
- allow(provider.api.release.rels[:assets]).to receive(:get).and_return({:data => nil})
344
- allow(provider.api.release.rels[:assets].get).to receive(:data).and_return([])
320
+ allow(provider.api).to receive(:release_assets).and_return([])
345
321
 
346
322
  expect(provider.api).to receive(:upload_asset).with("https://api.github.com/repos/foo/bar/releases/1234", "bar.txt", {:name=>"bar.txt", :content_type=>"text/plain"})
347
323
  expect(provider.api).to receive(:update_release).with(anything, hash_including(:prerelease => true, :name => 'true'))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl-releases
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.2.travis.2979.6
4
+ version: 1.10.2.travis.2987.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 1.10.2.travis.2979.6
19
+ version: 1.10.2.travis.2987.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 1.10.2.travis.2979.6
26
+ version: 1.10.2.travis.2987.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: octokit
29
29
  requirement: !ruby/object:Gem::Requirement