pem 0.7.3 → 0.8.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: 58b76a291f4f4d5357010fe9583c88e17110a41d
4
- data.tar.gz: 31b25b5ebd72a80b7b94cc30f63062413c9230d3
3
+ metadata.gz: c63744fac27ee4becfc297253279c9f0d0d17b4d
4
+ data.tar.gz: 10fc43cd0ed9fcf094b806f605b97e2bf2e90a35
5
5
  SHA512:
6
- metadata.gz: ad830aa3841d3f51a800ad8504df8b75a2a64a875d644986755658c56043eea2505c56fc2381cf35d40672c236335d1496a4f3a5025281ad4435e2a6382c0bfa
7
- data.tar.gz: 66dbc21cedb673c77ac87592f35abaa8ec489e629c528e32d588849e2d9877537b4e54819ab2d53380778202db395ce31e78693cef604d22a1da4550d4a0786f
6
+ metadata.gz: 269cdf9f61a91730afdbf632bdd53115e3b68421a3b7c3127c258bea2f452676266e90f15b0386f2d53283316b31d7e02f2c24c0389b90b92e32b6288da9f88f
7
+ data.tar.gz: f06f13638f120165c80bc69fdeda14c299fb56300bd67231ac27b386cb77b78132eb320091e33749b6ae6b9e6cdf1d6be22baaddf8933fa8cba88bfd6dbc3225
data/lib/pem/manager.rb CHANGED
@@ -5,11 +5,12 @@ module PEM
5
5
  # Creates the push profile and stores it in the correct location
6
6
  class Manager
7
7
  def self.start
8
- password_manager = CredentialsManager::PasswordManager.shared_manager
9
- Spaceship.login(password_manager.username, password_manager.password)
8
+ Helper.log.info "Starting login with user '#{PEM.config[:username]}'"
9
+ Spaceship.login(PEM.config[:username], nil)
10
10
  Spaceship.client.select_team
11
+ Helper.log.info "Successfully logged in"
11
12
 
12
- existing_certificate = certificate.all.detect do |c|
13
+ existing_certificate = certificate.all.detect do |c|
13
14
  c.name == PEM.config[:app_identifier]
14
15
  end
15
16
 
@@ -50,25 +51,22 @@ module PEM
50
51
  filename_base = File.basename(filename_base, ".pem") # strip off the .pem if it was provided.
51
52
 
52
53
  if PEM.config[:save_private_key]
53
- file = File.new("#{filename_base}.pkey",'w')
54
- file.write(pkey.to_pem)
55
- file.close
56
- Helper.log.info "Private key: ".green + Pathname.new(file).realpath.to_s
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
57
  end
58
58
 
59
59
  if PEM.config[:generate_p12]
60
+ p12_cert_path = File.join(PEM.config[:output_path], "#{filename_base}.p12")
60
61
  p12 = OpenSSL::PKCS12.create(PEM.config[:p12_password], certificate_type, pkey, x509_certificate)
61
- file = File.new("#{filename_base}.p12", 'wb')
62
- file.write(p12.to_der)
63
- file.close
64
- Helper.log.info "p12 certificate: ".green + Pathname.new(file).realpath.to_s
62
+ File.write(p12_cert_path, p12.to_der)
63
+ Helper.log.info "p12 certificate: ".green + Pathname.new(p12_cert_path).realpath.to_s
65
64
  end
66
65
 
67
- file = File.new("#{filename_base}.pem", 'w')
68
- file.write(x509_certificate.to_pem + pkey.to_pem)
69
- file.close
70
- Helper.log.info "PEM: ".green + Pathname.new(file).realpath.to_s
71
- return file
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
72
70
  end
73
71
 
74
72
  def self.certificate
data/lib/pem/options.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'fastlane_core'
2
+ require 'credentials_manager'
2
3
 
3
4
  module PEM
4
5
  class Options
@@ -12,12 +13,12 @@ module PEM
12
13
  FastlaneCore::ConfigItem.new(key: :generate_p12,
13
14
  env_name: "PEM_GENERATE_P12_FILE",
14
15
  description: "Generate a p12 file additionally to a PEM file",
15
- is_string: false,
16
+ is_string: false,
16
17
  default_value: true),
17
18
  FastlaneCore::ConfigItem.new(key: :save_private_key,
18
19
  short_option: "-s",
19
20
  env_name: "PEM_SAVE_PRIVATEKEY",
20
- description: "Set to save the private RSA key in the current directory",
21
+ description: "Set to save the private RSA key",
21
22
  is_string: false,
22
23
  default_value: true),
23
24
  FastlaneCore::ConfigItem.new(key: :force,
@@ -34,10 +35,7 @@ module PEM
34
35
  short_option: "-u",
35
36
  env_name: "PEM_USERNAME",
36
37
  description: "Your Apple ID Username",
37
- default_value: CredentialsManager::AppfileConfig.try_fetch_value(:apple_id),
38
- verify_block: Proc.new do |value|
39
- CredentialsManager::PasswordManager.shared_manager(value)
40
- end),
38
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)),
41
39
  FastlaneCore::ConfigItem.new(key: :team_id,
42
40
  short_option: "-b",
43
41
  env_name: "PEM_TEAM_ID",
@@ -55,7 +53,12 @@ module PEM
55
53
  short_option: "-o",
56
54
  env_name: "PEM_FILE_NAME",
57
55
  description: "The file name of the generated .pem file",
58
- optional: true)
56
+ optional: true),
57
+ FastlaneCore::ConfigItem.new(key: :output_path,
58
+ short_option: "-l",
59
+ env_name: "PEM_OUTPUT_PATH",
60
+ description: "The path to a directory in which all certificates and private keys should be stored",
61
+ default_value: ".")
59
62
  ]
60
63
  end
61
64
  end
data/lib/pem/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PEM
2
- VERSION = "0.7.3"
2
+ VERSION = "0.8.0"
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.3
4
+ version: 0.8.0
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-01 00:00:00.000000000 Z
11
+ date: 2015-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -16,28 +16,34 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.2
19
+ version: 0.16.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: 0.7.2
29
+ version: 0.16.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 1.0.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: spaceship
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: 0.4.0
39
+ version: 0.6.0
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
- version: 0.4.0
46
+ version: 0.6.0
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: bundler
43
49
  requirement: !ruby/object:Gem::Requirement