apple_certs_info 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: de39fe85e1a13045983617cabf735f9ecd6fc2e5cc6af99660fd0d1ef0b31d0d
4
- data.tar.gz: 3e6a000667f73e5fbef6e4d775521a6309a4e22bea5eb7c16c0ffdc4792b03d9
3
+ metadata.gz: 2118d6405e0a0a575a7d4e0d7df3926941ea4e416c3840621b436f4106016884
4
+ data.tar.gz: e1b5edff1ae416471f37d99faaaa8189f4ad9cfc5581459d373c69b26a2e2bc1
5
5
  SHA512:
6
- metadata.gz: 7ac766e20fe4ab929b1defc5d826c8d58c9132e2f2a8971455d27477f9bfaf092f0c4826680ba2a6334128504136fe643401e611d00391d6d2a70e805820bdd1
7
- data.tar.gz: 9de98afa3359a05ad92cefc2716f9bb6aee94cf5d8338d2bb5ff8942017aaeff16a25282d1f8ff6883807ee92568ba29a769a486639710f6e659f6cb535c37a2
6
+ metadata.gz: a482ce9fe6c5495db9fb48aa617fd1c232fd805e5837aa4bb390539c1f6976d8c983563df9900e67b7b9958a65609316553a797e3f39b967eb8ed2a152d5f7d2
7
+ data.tar.gz: 2568a6a3a46043bd9bfc140ac94888acf98b7df74803d7f12c06acc844b130291a2eeec0da3a2d9233abf69f1f8e7d3c72397bf641b220f0f3ac80ecab0772c4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- apple_certs_info (0.1.4)
4
+ apple_certs_info (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -13,11 +13,11 @@ module AppleCertsInfo
13
13
  @debug_log
14
14
  end
15
15
 
16
- # Check Certificate file for iPhone/Apple Developer in the KeyChain
16
+ # Check Certificate file for iPhone Developer /Apple Development in the KeyChain
17
17
  # @param days: limit days
18
18
  def self.certificate_development_list_limit_days_for(days:)
19
19
  raise "do not set days param" if days.nil?
20
- limit_days_for(days: days, type: "certificate_developer")
20
+ limit_days_for(days: days, type: "certificate_development")
21
21
  end
22
22
 
23
23
  # Check Certificate file for iPhone/Apple Distribution in the KeyChain
@@ -32,12 +32,16 @@ module AppleCertsInfo
32
32
  limit_days_for(days: days, type: "provisioning_profile")
33
33
  end
34
34
 
35
- def self.certificate_developer_list
36
- certificate_list_for(name: "Developer")
35
+ def self.certificate_development_list
36
+ list = []
37
+ list = certificate_list_for(name: "iPhone Developer")
38
+ list << certificate_list_for(name: "Apple Development")
37
39
  end
38
40
 
39
41
  def self.certificate_distribution_list
40
- certificate_list_for(name: "Distribution")
42
+ list = []
43
+ list = certificate_list_for(name: "iPhone Distribution")
44
+ list << certificate_list_for(name: "Apple Distribution")
41
45
  end
42
46
 
43
47
  def self.certificate_info_for(name:)
@@ -48,7 +52,6 @@ module AppleCertsInfo
48
52
  begin
49
53
  `security find-certificate -a -c "#{name}" -p > #{temp_pem_file.path}`
50
54
  result = `openssl x509 -text -fingerprint -noout -in #{temp_pem_file.path}`
51
- puts(result) if @debug_log == true
52
55
 
53
56
  expire_datetime_match = result.match(/.*Not After :(.*)/)
54
57
  raise "not exits expire date" if expire_datetime_match.nil?
@@ -56,7 +59,7 @@ module AppleCertsInfo
56
59
  expire_datetime = Time.parse(expire_datetime_match[1])
57
60
 
58
61
  cname_match = result.match(/Subject: .* CN=(.*), OU=.*/)
59
- raise "not exists cname" if cname_match.nil?
62
+ raise "not exists cname:#{result}" if cname_match.nil?
60
63
  cname = cname_match[1]
61
64
 
62
65
  limit_days = calc_limit_days(datetime: expire_datetime)
@@ -114,8 +117,8 @@ module AppleCertsInfo
114
117
  private
115
118
  def self.limit_days_for(days:, type:)
116
119
  case type
117
- when "certificate_developer" then
118
- list = certificate_developer_list
120
+ when "certificate_development" then
121
+ list = certificate_development_list
119
122
  when "certificate_distribution" then
120
123
  list = certificate_distribution_list
121
124
  when "provisioning_profile" then
@@ -1,3 +1,3 @@
1
1
  module AppleCertsInfo
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple_certs_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshiyuki Hirata