dpl-releases 1.9.2 → 1.9.3

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: 1a775f2175b927f74dec42f647014ece70429d7e
4
- data.tar.gz: 6465c2ee89521d1690b9e56ae41625725d5d4867
3
+ metadata.gz: 9c7a94d142680d28f0dbdd41aa34e3afda8c4f5d
4
+ data.tar.gz: 331b93df95e18200752ff8cda3cda55bc11f5d27
5
5
  SHA512:
6
- metadata.gz: 63dbe694f4f4740f7d96ca1dae919abf3ea34afd08e60ba375b06f69b8aa09ec47ad3d9f946a3844415e266536a304f3740a9fb22af61ec9caa7614e799748e3
7
- data.tar.gz: 47474656c77a7af06a56f2848cd37836cc4b928b1b4ecab4649b04c385f0db924307a0333f5ad245167f8c98bd7582e17b80e1a54c127ad2d68bd91c680c7812
6
+ metadata.gz: 9653acb74650695e34ff0edae6536a59158df963c0e3499f81440b8c147394bcb245ba21fede1e2acbe3b130e931f11788d4fac07686ea892d39e1b235caf0a8
7
+ data.tar.gz: 723b54c7101a3b078d3af2f19d22f7238d99bdb5ef15275f8c67ddf1bf216e8193735f59e187d33d5e059f2c33b11321b7b4fae772b3987278221abb46d2a31e
@@ -6,6 +6,11 @@ module DPL
6
6
  class Releases < Provider
7
7
  require 'pathname'
8
8
 
9
+ BOOLEAN_PARAMS = %w(
10
+ draft
11
+ prerelease
12
+ )
13
+
9
14
  def travis_tag
10
15
  # Check if $TRAVIS_TAG is unset or set but empty
11
16
  if context.env.fetch('TRAVIS_TAG','') == ''
@@ -135,12 +140,15 @@ module DPL
135
140
 
136
141
  def booleanize!(opts)
137
142
  opts.map do |k,v|
138
- opts[k] =
139
- case v.to_s.downcase
140
- when 'true'
141
- true
142
- when 'false'
143
- false
143
+ opts[k] = if BOOLEAN_PARAMS.include?(k.to_s.squeeze.downcase)
144
+ case v.to_s.downcase
145
+ when 'true'
146
+ true
147
+ when 'false'
148
+ false
149
+ else
150
+ v
151
+ end
144
152
  else
145
153
  v
146
154
  end
@@ -327,5 +327,26 @@ describe DPL::Provider::Releases do
327
327
 
328
328
  provider.push_app
329
329
  end
330
+
331
+ example "When release name is 'true'" do
332
+ allow_message_expectations_on_nil
333
+
334
+ provider.options.update(:file => ["bar.txt"])
335
+ provider.options.update(:release_number => "1234")
336
+ provider.options.update(:prerelease => 'true')
337
+ provider.options.update(:name => 'true')
338
+ allow(provider).to receive(:slug).and_return("foo/bar")
339
+ expect(File).to receive(:file?).with("bar.txt").and_return(true)
340
+
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([])
345
+
346
+ 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
+ expect(provider.api).to receive(:update_release).with(anything, hash_including(:prerelease => true, :name => 'true'))
348
+
349
+ provider.push_app
350
+ end
330
351
  end
331
352
  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
4
+ version: 1.9.3
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
19
+ version: 1.9.3
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
26
+ version: 1.9.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: octokit
29
29
  requirement: !ruby/object:Gem::Requirement