pem 0.7.2 → 0.7.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: 3d03a2096c7084f9c3b8c37bcbe0abc5d77bf5be
4
- data.tar.gz: 372d18aa4001848475a313df68f04142d8dd6cf6
3
+ metadata.gz: 58b76a291f4f4d5357010fe9583c88e17110a41d
4
+ data.tar.gz: 31b25b5ebd72a80b7b94cc30f63062413c9230d3
5
5
  SHA512:
6
- metadata.gz: fbb106cf6d2465fb226641dd6bb58939c3ab8ba9d9cd712d5ddb35c9ac15a1afb8e3b1b6a84d41911900399c84ff3c0467505ef41e216c1abd944d8bf4fa8505
7
- data.tar.gz: dcaaf4326beef23212591670796d0cf4a3caa7528866d23e1a1f6e1ba4289221621213e508c6c72aeb39b9695abc5e351fd30f1a3203b437e87dc27210731406
6
+ metadata.gz: ad830aa3841d3f51a800ad8504df8b75a2a64a875d644986755658c56043eea2505c56fc2381cf35d40672c236335d1496a4f3a5025281ad4435e2a6382c0bfa
7
+ data.tar.gz: 66dbc21cedb673c77ac87592f35abaa8ec489e629c528e32d588849e2d9877537b4e54819ab2d53380778202db395ce31e78693cef604d22a1da4550d4a0786f
data/lib/pem/manager.rb CHANGED
@@ -4,13 +4,14 @@ require 'spaceship'
4
4
  module PEM
5
5
  # Creates the push profile and stores it in the correct location
6
6
  class Manager
7
-
8
7
  def self.start
9
8
  password_manager = CredentialsManager::PasswordManager.shared_manager
10
9
  Spaceship.login(password_manager.username, password_manager.password)
11
10
  Spaceship.client.select_team
12
11
 
13
- existing_certificate = Spaceship.certificate.all.detect { |c| c.name == PEM.config[:app_identifier] }
12
+ existing_certificate = certificate.all.detect do |c|
13
+ c.name == PEM.config[:app_identifier]
14
+ end
14
15
 
15
16
  if existing_certificate
16
17
  remaining_days = (existing_certificate.expires - Time.now) / 60 / 60 / 24
@@ -31,11 +32,7 @@ module PEM
31
32
  csr, pkey = Spaceship.certificate.create_certificate_signing_request
32
33
 
33
34
  begin
34
- if PEM.config[:development]
35
- cert = Spaceship.certificate.development_push.create!(csr: csr, bundle_id: PEM.config[:app_identifier])
36
- else
37
- cert = Spaceship.certificate.production_push.create!(csr: csr, bundle_id: PEM.config[:app_identifier])
38
- end
35
+ cert = certificate.create!(csr: csr, bundle_id: PEM.config[:app_identifier])
39
36
  rescue => ex
40
37
  if ex.to_s.include?"You already have a current"
41
38
  # That's the most common failure probably
@@ -60,7 +57,6 @@ module PEM
60
57
  end
61
58
 
62
59
  if PEM.config[:generate_p12]
63
- certificate_type = (PEM.config[:development] ? 'development' : 'production')
64
60
  p12 = OpenSSL::PKCS12.create(PEM.config[:p12_password], certificate_type, pkey, x509_certificate)
65
61
  file = File.new("#{filename_base}.p12", 'wb')
66
62
  file.write(p12.to_der)
@@ -74,5 +70,13 @@ module PEM
74
70
  Helper.log.info "PEM: ".green + Pathname.new(file).realpath.to_s
75
71
  return file
76
72
  end
73
+
74
+ def self.certificate
75
+ if PEM.config[:development]
76
+ Spaceship.certificate.development_push
77
+ else
78
+ Spaceship.certificate.production_push
79
+ end
80
+ end
77
81
  end
78
82
  end
data/lib/pem/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PEM
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-25 00:00:00.000000000 Z
11
+ date: 2015-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core