apple_certs_info 0.1.4 → 0.2.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
  SHA256:
3
- metadata.gz: de39fe85e1a13045983617cabf735f9ecd6fc2e5cc6af99660fd0d1ef0b31d0d
4
- data.tar.gz: 3e6a000667f73e5fbef6e4d775521a6309a4e22bea5eb7c16c0ffdc4792b03d9
3
+ metadata.gz: 8919e7f716548ce695171e206e2fb3eeb7c3a27d3bc09165c4aecf09faf921ad
4
+ data.tar.gz: b5fd6e5598c774e9213df13956b609bf5f304851712374854a55aca5c78c962d
5
5
  SHA512:
6
- metadata.gz: 7ac766e20fe4ab929b1defc5d826c8d58c9132e2f2a8971455d27477f9bfaf092f0c4826680ba2a6334128504136fe643401e611d00391d6d2a70e805820bdd1
7
- data.tar.gz: 9de98afa3359a05ad92cefc2716f9bb6aee94cf5d8338d2bb5ff8942017aaeff16a25282d1f8ff6883807ee92568ba29a769a486639710f6e659f6cb535c37a2
6
+ metadata.gz: 915eafd2ce442ad64472816068ce04b0695c63250981f120fafffcad32981ef430df1ab0611f13cc98a9b497ef53625888d0f3bdb2029fdf60a4244d8a5b796a
7
+ data.tar.gz: df12e08a66305f18768cb2770c59a184c6587291d00b1d2dac28d753a535b20d388ba970d2cb232b859ee95072581243bb1985a5420429dbeaecc571c536f8bd
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at toshiyuki.hirata@dena.com. All
58
+ reported by contacting the project team at tarappo@gmail.com. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -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.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -30,10 +30,10 @@ AppleCertsInfo.provisioning_profile_list_limit_days_for(days: 10)
30
30
 
31
31
 
32
32
  ```
33
- # Development
33
+ # iPhone Developer / Apple Development
34
34
  AppleCertsInfo.certificate_development_list_limit_days_for(days: 10)
35
35
 
36
- # Distribution
36
+ # iPhone / Apple Distribution
37
37
  AppleCertsInfo.certificate_distribution_list_limit_days_for(days: 10)
38
38
  ```
39
39
 
@@ -3,8 +3,8 @@ require_relative 'lib/apple_certs_info/version'
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "apple_certs_info"
5
5
  spec.version = AppleCertsInfo::VERSION
6
- spec.authors = ["Toshiyuki Hirata"]
7
- spec.email = ["toshiyuki.hirata@dena.com"]
6
+ spec.authors = ["tarappo"]
7
+ spec.email = ["tarappo@gmail.com"]
8
8
 
9
9
  spec.summary = %q{Apple Certificate files and Provisioning Profile information.}
10
10
  spec.homepage = "https://github.com/tarappo/apple_certs_info"
@@ -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,22 @@ 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
+ iphone_list = certificate_list_for(name: "iPhone Developer")
38
+ apple_list = certificate_list_for(name: "Apple Development")
39
+ list.concat(iphone_list)
40
+ list.concat(apple_list)
41
+ return list.uniq
37
42
  end
38
43
 
39
44
  def self.certificate_distribution_list
40
- certificate_list_for(name: "Distribution")
45
+ list = []
46
+ iphone_list = certificate_list_for(name: "iPhone Distribution")
47
+ apple_list = certificate_list_for(name: "Apple Distribution")
48
+ list.concat(iphone_list)
49
+ list.concat(apple_list)
50
+ return list.uniq
41
51
  end
42
52
 
43
53
  def self.certificate_info_for(name:)
@@ -48,7 +58,6 @@ module AppleCertsInfo
48
58
  begin
49
59
  `security find-certificate -a -c "#{name}" -p > #{temp_pem_file.path}`
50
60
  result = `openssl x509 -text -fingerprint -noout -in #{temp_pem_file.path}`
51
- puts(result) if @debug_log == true
52
61
 
53
62
  expire_datetime_match = result.match(/.*Not After :(.*)/)
54
63
  raise "not exits expire date" if expire_datetime_match.nil?
@@ -56,7 +65,7 @@ module AppleCertsInfo
56
65
  expire_datetime = Time.parse(expire_datetime_match[1])
57
66
 
58
67
  cname_match = result.match(/Subject: .* CN=(.*), OU=.*/)
59
- raise "not exists cname" if cname_match.nil?
68
+ raise "not exists cname:#{result}" if cname_match.nil?
60
69
  cname = cname_match[1]
61
70
 
62
71
  limit_days = calc_limit_days(datetime: expire_datetime)
@@ -114,8 +123,8 @@ module AppleCertsInfo
114
123
  private
115
124
  def self.limit_days_for(days:, type:)
116
125
  case type
117
- when "certificate_developer" then
118
- list = certificate_developer_list
126
+ when "certificate_development" then
127
+ list = certificate_development_list
119
128
  when "certificate_distribution" then
120
129
  list = certificate_distribution_list
121
130
  when "provisioning_profile" then
@@ -125,7 +134,7 @@ module AppleCertsInfo
125
134
 
126
135
  danger_list = []
127
136
  list.each do |info|
128
- danger_list << info if info[:limit_days] <= days
137
+ danger_list << info if info[:limit_days].to_i <= days.to_i
129
138
  end
130
139
 
131
140
  danger_list
@@ -1,3 +1,3 @@
1
1
  module AppleCertsInfo
2
- VERSION = "0.1.4"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,10 +1,10 @@
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.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Toshiyuki Hirata
7
+ - tarappo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
@@ -12,7 +12,7 @@ date: 2021-01-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
15
- - toshiyuki.hirata@dena.com
15
+ - tarappo@gmail.com
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []