dpl-releases 1.9.2.travis.2763.5 → 1.9.2.travis.2764.5

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: 69997ff1770f3d84a98d04e028513177b4dac10d3b41c5a8915153d84fba21b5
4
- data.tar.gz: e3ad0f0b75babbc3c9d1a799ab52a7e71d755f918e3a0e042e241a13df4a8195
3
+ metadata.gz: 8c59796a0d3f4a86903a2ea270b82dcbf23c4b0bddc2f1b06a6e0105e7570c22
4
+ data.tar.gz: 9d5eecd5cb7ae6c6bb8f903c3617acf61cde26161cd302f607e3b529e0a6f63f
5
5
  SHA512:
6
- metadata.gz: 76cfe5e6bd71c25764a172d7168978b9d687679a7418b72d1557e9d691e5b3176a062a9c1854562e77d07234430d62ae1943d9414e71462f45efdecba8dce540
7
- data.tar.gz: 2466ea8871d675c45f605c50015366fd79c934ab112a0730a4389437195178570f33ee158637589adf55d2da95c4f146695c2bbec44da3c7c9f52eb6573e82a5
6
+ metadata.gz: f095ef667991beec82c0246551477816343eef2818b87bd325f1a72d2c244725bfe938754adc382e787d1718e4d10dd34d77c76deac25da8c635259c224d9709
7
+ data.tar.gz: 01ae12d104d95b7d96430330cdf3408ffa8ba687924c9fcdd53354b96206a6288b9b7b93794cf6c38a8af8c257b820c0a1caf4702d055fc355708f2706d0a013
@@ -82,6 +82,8 @@ module DPL
82
82
  tag_matched = false
83
83
  release_url = nil
84
84
 
85
+ booleanize!(options)
86
+
85
87
  if options[:release_number]
86
88
  tag_matched = true
87
89
  release_url = "https://api.github.com/repos/" + slug + "/releases/" + options[:release_number]
@@ -130,6 +132,20 @@ module DPL
130
132
  end
131
133
  api.upload_asset(release_url, file, {:name => filename, :content_type => content_type})
132
134
  end
135
+
136
+ def booleanize!(opts)
137
+ opts.map do |k,v|
138
+ opts[k] =
139
+ case v.to_s.downcase
140
+ when 'true'
141
+ true
142
+ when 'false'
143
+ false
144
+ else
145
+ v
146
+ end
147
+ end
148
+ end
133
149
  end
134
150
  end
135
151
  end
@@ -307,5 +307,25 @@ describe DPL::Provider::Releases do
307
307
 
308
308
  provider.push_app
309
309
  end
310
+
311
+ example "When prerelease is 'true'" do
312
+ allow_message_expectations_on_nil
313
+
314
+ provider.options.update(:file => ["bar.txt"])
315
+ provider.options.update(:release_number => "1234")
316
+ provider.options.update(:prerelease => 'true')
317
+ allow(provider).to receive(:slug).and_return("foo/bar")
318
+ expect(File).to receive(:file?).with("bar.txt").and_return(true)
319
+
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([])
324
+
325
+ 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
+ expect(provider.api).to receive(:update_release).with(anything, hash_including(:prerelease => true))
327
+
328
+ provider.push_app
329
+ end
310
330
  end
311
331
  end
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.9.2.travis.2763.5
4
+ version: 1.9.2.travis.2764.5
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.9.2.travis.2763.5
19
+ version: 1.9.2.travis.2764.5
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.9.2.travis.2763.5
26
+ version: 1.9.2.travis.2764.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: octokit
29
29
  requirement: !ruby/object:Gem::Requirement