push_package 0.3.0 → 0.4.0

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: 6b3e8b567c6ebb1888e02f3cf5157b9bdbd08671
4
- data.tar.gz: fe51748466b8ff36fb7325c48dca56816bf7ed2e
3
+ metadata.gz: 993a2f7345ad1bee0c5aa221936e44e322f63b39
4
+ data.tar.gz: 09023bbe6ad97d1ebc1e3a97c7b028114aea0ec3
5
5
  SHA512:
6
- metadata.gz: 73ec74740ad3a70e0eda382a98bb112b9c8f8fc5d6b795dcfd67342b2f81c8f0d8338d5426dffb3fe624bbd16c03489f4648770e47a53f7178a32df7aa592f2f
7
- data.tar.gz: e238cc025564ea70167df852b8edd1e3836a944d02e07f998255d3c0e9f66cf1ca6a270a78c45b672d3ddcef60d7c0f09665e492e2a825878d588c66412b37fb
6
+ metadata.gz: e3ee7036717ed8f3ab09912d0fc56ed497c2f13c3472371f6fd3c7cb305ee88a45b898db5a2fa69262693382a94bd3bd891767be1dbc14f0cc10039e18cfb912
7
+ data.tar.gz: f479ef6728e2744759ca348d28afc42f730d5e72c40c006835b3324cef2759fe2b0265506737af66d8800a81624fc327f06597f842c27cf928593b2f1204e386
@@ -1,11 +1,9 @@
1
1
  ---
2
2
  language: ruby
3
3
  rvm:
4
- - 1.9.2
5
- - 1.9.3
6
- - 2.0.0
7
4
  - 2.1.5
8
5
  - 2.2.3
6
+ - 2.3.0
9
7
  - jruby-19mode
10
8
  sudo: false
11
9
  notifications:
@@ -21,7 +21,7 @@ class PushPackage
21
21
  raise ArgumentError unless certificate
22
22
 
23
23
  @website_params = website_params
24
- @iconset_path = iconset_path
24
+ @iconset_path = iconset_path.to_s
25
25
 
26
26
  if certificate.respond_to?(:read)
27
27
  cert_data = certificate.read
@@ -1,3 +1,3 @@
1
1
  class PushPackage
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
21
21
 
22
22
  gem.add_runtime_dependency 'rubyzip', '~> 1.1', '>= 1.1.0'
23
23
 
24
- gem.add_development_dependency 'minitest', '~> 4.7.0', '>= 4.7.0'
24
+ gem.add_development_dependency 'minitest', '~> 5.8.4', '>= 5.8.4'
25
25
  gem.add_development_dependency 'rake', '~> 10.0', '>= 10.0.3'
26
26
  gem.add_development_dependency 'pry', '~> 0'
27
27
  end
@@ -145,6 +145,14 @@ describe PushPackage do
145
145
  File.delete(file.path)
146
146
  end
147
147
 
148
+ it 'supports using a Pathname for iconset_path' do
149
+ iconset_pathname = Pathname.new(iconset_path)
150
+ push_package = PushPackage.new(website_params, iconset_pathname, certificate, 'testing')
151
+ file = push_package.save
152
+ File.exist?(file.path).must_equal true
153
+ File.delete(file.path)
154
+ end
155
+
148
156
  it 'should return the file handle' do
149
157
  file = push_package.save(output_path)
150
158
  file.must_be_instance_of File
@@ -194,14 +202,27 @@ describe PushPackage do
194
202
  end
195
203
 
196
204
  describe 'when intermediate_cert given' do
197
- let(:intermediate_cert) { File.open(fixture_path('intermediate.crt')) }
198
- let(:push_package) { PushPackage.new(website_params, iconset_path, certificate, 'testing', intermediate_cert) }
199
-
200
- it 'should have one extra cert in signature' do
201
- extracted_package.must_include('signature')
202
- signature = File.read(tmp_path + '/signature')
203
- p7 = OpenSSL::PKCS7.new(signature)
204
- p7.certificates().size.must_equal 2
205
+ describe 'when intermediate_cert is a string' do
206
+ let(:intermediate_cert) { fixture_path('intermediate.crt') }
207
+ let(:push_package) { PushPackage.new(website_params, iconset_path, certificate, 'testing', intermediate_cert) }
208
+
209
+ it 'should have one extra cert in signature' do
210
+ extracted_package.must_include('signature')
211
+ signature = File.read(tmp_path + '/signature')
212
+ p7 = OpenSSL::PKCS7.new(signature)
213
+ p7.certificates().size.must_equal 2
214
+ end
215
+ end
216
+ describe 'when intermediate_cert is a Pathname' do
217
+ let(:intermediate_cert) { Pathname.new(fixture_path('intermediate.crt')) }
218
+ let(:push_package) { PushPackage.new(website_params, iconset_path, certificate, 'testing', intermediate_cert) }
219
+
220
+ it 'should have one extra cert in signature' do
221
+ extracted_package.must_include('signature')
222
+ signature = File.read(tmp_path + '/signature')
223
+ p7 = OpenSSL::PKCS7.new(signature)
224
+ p7.certificates().size.must_equal 2
225
+ end
205
226
  end
206
227
  end
207
228
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: push_package
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-16 00:00:00.000000000 Z
12
+ date: 2016-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubyzip
@@ -37,20 +37,20 @@ dependencies:
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 4.7.0
40
+ version: 5.8.4
41
41
  - - '>='
42
42
  - !ruby/object:Gem::Version
43
- version: 4.7.0
43
+ version: 5.8.4
44
44
  type: :development
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - ~>
49
49
  - !ruby/object:Gem::Version
50
- version: 4.7.0
50
+ version: 5.8.4
51
51
  - - '>='
52
52
  - !ruby/object:Gem::Version
53
- version: 4.7.0
53
+ version: 5.8.4
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: rake
56
56
  requirement: !ruby/object:Gem::Requirement