pem 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c63744fac27ee4becfc297253279c9f0d0d17b4d
4
- data.tar.gz: 10fc43cd0ed9fcf094b806f605b97e2bf2e90a35
3
+ metadata.gz: a0b32385a65fea0f12fc5eb645fe1f0e3e9fdb63
4
+ data.tar.gz: 097ce337c4fb019752c283a8d4be436c8b54fc36
5
5
  SHA512:
6
- metadata.gz: 269cdf9f61a91730afdbf632bdd53115e3b68421a3b7c3127c258bea2f452676266e90f15b0386f2d53283316b31d7e02f2c24c0389b90b92e32b6288da9f88f
7
- data.tar.gz: f06f13638f120165c80bc69fdeda14c299fb56300bd67231ac27b386cb77b78132eb320091e33749b6ae6b9e6cdf1d6be22baaddf8933fa8cba88bfd6dbc3225
6
+ metadata.gz: 66e36259fcd8f0870760122e8f5d5208193d11511757582a33ed51304e937fcb7df282081bdff64914d4fea377e621f3ac3230ed675c87d3d4af7a5143960d4c
7
+ data.tar.gz: 661929ad101fd354bf134bc7849e685066b777e66e7a6d71e61d91a15e6e2aa5aa7312b1228ac8385f305a4e37bfbc26a815c2a1d13821eb675551d29d0d844b
data/README.md CHANGED
@@ -36,7 +36,7 @@ PEM
36
36
 
37
37
  Tired of manually creating and maintaining your push notification profiles for your iOS apps? Tired of generating a `pem` file for your server?
38
38
 
39
- ```PEM``` does all that for, just by running ```pem```.
39
+ `PEM` does all that for, just by running `pem`.
40
40
 
41
41
  To automate iOS Provisioning profiles you can use [sigh](https://github.com/KrauseFx/sigh).
42
42
 
data/bin/pem CHANGED
@@ -44,4 +44,4 @@ begin
44
44
  PemApplication.new.run
45
45
  ensure
46
46
  FastlaneCore::UpdateChecker.show_update_status('pem', PEM::VERSION)
47
- end
47
+ end
data/lib/pem.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'pem/version'
2
- require 'pem/dependency_checker'
3
2
  require 'pem/manager'
4
3
  require 'pem/options'
5
4
 
@@ -18,6 +17,4 @@ module PEM
18
17
  ENV['DELIVER_USER'] ||= ENV["PEM_USERNAME"]
19
18
 
20
19
  Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
21
-
22
- DependencyChecker.check_dependencies
23
20
  end
data/lib/pem/manager.rb CHANGED
@@ -4,76 +4,88 @@ require 'spaceship'
4
4
  module PEM
5
5
  # Creates the push profile and stores it in the correct location
6
6
  class Manager
7
- def self.start
8
- Helper.log.info "Starting login with user '#{PEM.config[:username]}'"
9
- Spaceship.login(PEM.config[:username], nil)
10
- Spaceship.client.select_team
11
- Helper.log.info "Successfully logged in"
7
+ class << self
8
+ def start
9
+ login
12
10
 
13
- existing_certificate = certificate.all.detect do |c|
14
- c.name == PEM.config[:app_identifier]
15
- end
11
+ existing_certificate = certificate.all.detect do |c|
12
+ c.name == PEM.config[:app_identifier]
13
+ end
16
14
 
17
- if existing_certificate
18
- remaining_days = (existing_certificate.expires - Time.now) / 60 / 60 / 24
19
- Helper.log.info "Existing push notification profile '#{existing_certificate.owner_name}' is valid for #{remaining_days.round} more days."
20
- if remaining_days > 30
21
- if PEM.config[:force]
22
- Helper.log.info "You already have an existing push certificate, but a new one will be created since the --force option has been set.".green
23
- else
24
- Helper.log.info "You already have a push certificate, which is active for more than 30 more days. No need to create a new one".green
25
- Helper.log.info "If you still want to create a new one, use the --force option when running PEM.".green
26
- return false
15
+ if existing_certificate
16
+ remaining_days = (existing_certificate.expires - Time.now) / 60 / 60 / 24
17
+ Helper.log.info "Existing push notification profile '#{existing_certificate.owner_name}' is valid for #{remaining_days.round} more days."
18
+ if remaining_days > 30
19
+ if PEM.config[:force]
20
+ Helper.log.info "You already have an existing push certificate, but a new one will be created since the --force option has been set.".green
21
+ else
22
+ Helper.log.info "You already have a push certificate, which is active for more than 30 more days. No need to create a new one".green
23
+ Helper.log.info "If you still want to create a new one, use the --force option when running PEM.".green
24
+ return false
25
+ end
27
26
  end
28
27
  end
28
+
29
+ return create_certificate
29
30
  end
30
31
 
31
- Helper.log.warn "Creating a new push certificate for app '#{PEM.config[:app_identifier]}'."
32
+ def login
33
+ Helper.log.info "Starting login with user '#{PEM.config[:username]}'"
34
+ Spaceship.login(PEM.config[:username], nil)
35
+ Spaceship.client.select_team
36
+ Helper.log.info "Successfully logged in"
37
+ end
32
38
 
33
- csr, pkey = Spaceship.certificate.create_certificate_signing_request
39
+ # rubocop:disable Metrics/AbcSize
40
+ def create_certificate
41
+ Helper.log.warn "Creating a new push certificate for app '#{PEM.config[:app_identifier]}'."
34
42
 
35
- begin
36
- cert = certificate.create!(csr: csr, bundle_id: PEM.config[:app_identifier])
37
- rescue => ex
38
- if ex.to_s.include?"You already have a current"
39
- # That's the most common failure probably
40
- Helper.log.info ex.to_s
41
- Helper.log.error "You already have 2 active push profiles for this application/environment.".red
42
- Helper.log.error "You'll need to revoke an old certificate to make room for a new one".red
43
- else
44
- raise ex
43
+ csr, pkey = Spaceship.certificate.create_certificate_signing_request
44
+
45
+ begin
46
+ cert = certificate.create!(csr: csr, bundle_id: PEM.config[:app_identifier])
47
+ rescue => ex
48
+ if ex.to_s.include? "You already have a current"
49
+ # That's the most common failure probably
50
+ Helper.log.info ex.to_s
51
+ Helper.log.error "You already have 2 active push profiles for this application/environment.".red
52
+ Helper.log.error "You'll need to revoke an old certificate to make room for a new one".red
53
+ else
54
+ raise ex
55
+ end
45
56
  end
46
- end
47
57
 
48
- x509_certificate = cert.download
49
- certificate_type = (PEM.config[:development] ? 'development' : 'production')
50
- filename_base = PEM.config[:pem_name] || "#{certificate_type}_#{PEM.config[:app_identifier]}"
51
- filename_base = File.basename(filename_base, ".pem") # strip off the .pem if it was provided.
58
+ x509_certificate = cert.download
59
+ certificate_type = (PEM.config[:development] ? 'development' : 'production')
60
+ filename_base = PEM.config[:pem_name] || "#{certificate_type}_#{PEM.config[:app_identifier]}"
61
+ filename_base = File.basename(filename_base, ".pem") # strip off the .pem if it was provided.
52
62
 
53
- if PEM.config[:save_private_key]
54
- private_key_path = File.join(PEM.config[:output_path], "#{filename_base}.pkey")
55
- File.write(private_key_path, pkey.to_pem)
56
- Helper.log.info "Private key: ".green + Pathname.new(private_key_path).realpath.to_s
57
- end
63
+ if PEM.config[:save_private_key]
64
+ private_key_path = File.join(PEM.config[:output_path], "#{filename_base}.pkey")
65
+ File.write(private_key_path, pkey.to_pem)
66
+ Helper.log.info "Private key: ".green + Pathname.new(private_key_path).realpath.to_s
67
+ end
58
68
 
59
- if PEM.config[:generate_p12]
60
- p12_cert_path = File.join(PEM.config[:output_path], "#{filename_base}.p12")
61
- p12 = OpenSSL::PKCS12.create(PEM.config[:p12_password], certificate_type, pkey, x509_certificate)
62
- File.write(p12_cert_path, p12.to_der)
63
- Helper.log.info "p12 certificate: ".green + Pathname.new(p12_cert_path).realpath.to_s
64
- end
69
+ if PEM.config[:generate_p12]
70
+ p12_cert_path = File.join(PEM.config[:output_path], "#{filename_base}.p12")
71
+ p12 = OpenSSL::PKCS12.create(PEM.config[:p12_password], certificate_type, pkey, x509_certificate)
72
+ File.write(p12_cert_path, p12.to_der)
73
+ Helper.log.info "p12 certificate: ".green + Pathname.new(p12_cert_path).realpath.to_s
74
+ end
65
75
 
66
- x509_cert_path = File.join(PEM.config[:output_path], "#{filename_base}.pem")
67
- File.write(x509_cert_path, x509_certificate.to_pem + pkey.to_pem)
68
- Helper.log.info "PEM: ".green + Pathname.new(x509_cert_path).realpath.to_s
69
- return x509_cert_path
70
- end
76
+ x509_cert_path = File.join(PEM.config[:output_path], "#{filename_base}.pem")
77
+ File.write(x509_cert_path, x509_certificate.to_pem + pkey.to_pem)
78
+ Helper.log.info "PEM: ".green + Pathname.new(x509_cert_path).realpath.to_s
79
+ return x509_cert_path
80
+ end
81
+ # rubocop:enable Metrics/AbcSize
71
82
 
72
- def self.certificate
73
- if PEM.config[:development]
74
- Spaceship.certificate.development_push
75
- else
76
- Spaceship.certificate.production_push
83
+ def certificate
84
+ if PEM.config[:development]
85
+ Spaceship.certificate.development_push
86
+ else
87
+ Spaceship.certificate.production_push
88
+ end
77
89
  end
78
90
  end
79
91
  end
data/lib/pem/options.rb CHANGED
@@ -41,8 +41,8 @@ module PEM
41
41
  env_name: "PEM_TEAM_ID",
42
42
  description: "The ID of your team if you're in multiple teams",
43
43
  optional: true,
44
- verify_block: Proc.new do |value|
45
- ENV["FASTLANE_TEAM_ID"] = value
44
+ verify_block: proc do |value|
45
+ ENV["FASTLANE_TEAM_ID"] = value
46
46
  end),
47
47
  FastlaneCore::ConfigItem.new(key: :p12_password,
48
48
  short_option: "-p",
data/lib/pem/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PEM
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
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.8.0
4
+ version: 0.8.1
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-09-07 00:00:00.000000000 Z
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.16.0
19
+ version: 0.19.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.16.0
29
+ version: 0.19.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.0
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 0.6.0
39
+ version: 0.11.2
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.6.0
46
+ version: 0.11.2
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -142,6 +142,34 @@ dependencies:
142
142
  - - ">="
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: fastlane
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ - !ruby/object:Gem::Dependency
160
+ name: rubocop
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '0.34'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '0.34'
145
173
  description: Automatically generate and renew your push notification profiles
146
174
  email:
147
175
  - pem@krausefx.com
@@ -154,7 +182,6 @@ files:
154
182
  - README.md
155
183
  - bin/pem
156
184
  - lib/pem.rb
157
- - lib/pem/dependency_checker.rb
158
185
  - lib/pem/manager.rb
159
186
  - lib/pem/options.rb
160
187
  - lib/pem/version.rb
@@ -178,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
205
  version: '0'
179
206
  requirements: []
180
207
  rubyforge_project:
181
- rubygems_version: 2.4.6
208
+ rubygems_version: 2.4.5
182
209
  signing_key:
183
210
  specification_version: 4
184
211
  summary: Automatically generate and renew your push notification profiles
@@ -1,19 +0,0 @@
1
- module PEM
2
- class DependencyChecker
3
- def self.check_dependencies
4
- return if Helper.is_test?
5
- self.check_xcode_select
6
- end
7
-
8
- def self.check_xcode_select
9
- unless `xcode-select -v`.include?("xcode-select version ")
10
- Helper.log.fatal '#############################################################'
11
- Helper.log.fatal "# You have to install the Xcode commdand line tools to use PEM"
12
- Helper.log.fatal "# Install the latest version of Xcode from the AppStore"
13
- Helper.log.fatal "# Run xcode-select --install to install the developer tools"
14
- Helper.log.fatal '#############################################################'
15
- raise "Run 'xcode-select --install' and start PEM again"
16
- end
17
- end
18
- end
19
- end