apple_certs_info 0.1.3 → 0.1.8

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: 81e12dc587106f1e3727c9d4fe165781548761381cbd6215dcca6b8467864404
4
- data.tar.gz: b68ffce0ba53516a3b15613a697991f7ec272dad49956fba6074cfd8e18883ea
3
+ metadata.gz: af7f8229f8689f9d7a2f36440999dde63b2a46c9e4429288765e3e4559b3ade8
4
+ data.tar.gz: ff41a08af497ea80f00f7cc29dd2d4b760d84fb48c2d8a7051b0b17c3c1af002
5
5
  SHA512:
6
- metadata.gz: a56424c938a07c2daf59572f57249b9549bc2eebd7d5b405076bc94212208eb3984db11f0847c4922436a0d68b7f298de5b583a6f943520bd90d046e0af0348f
7
- data.tar.gz: 56f3f307f70f5594b0af7c04faa7d769a4e3d36e0d3d9abaee907b368166dd1bea6cc960056a716c5fab3e0d9e80c735440bcc9254d789624fe816de19168405
6
+ metadata.gz: 7a5dacb311d712650309fdab78945c01fcbd245de49fdf75e72762e3111b6a792e2b6d70cc996ae7b7aa4836c2a2195f72f3653e7330a78b3a527a9c4bbf9af8
7
+ data.tar.gz: 9b21b435a7bb05be3999187bec9c09fe96ef5c95df7438b22f968d85dd2a4188a4d7f69e3cb7dd17e17feeb5a9c3b72a14113d7b516519fbecdf24f3a4a51c0a
@@ -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.3)
4
+ apple_certs_info (0.1.8)
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
 
@@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
4
4
  spec.name = "apple_certs_info"
5
5
  spec.version = AppleCertsInfo::VERSION
6
6
  spec.authors = ["Toshiyuki Hirata"]
7
- spec.email = ["toshiyuki.hirata@dena.com"]
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,7 +13,7 @@ module AppleCertsInfo
13
13
  @debug_log
14
14
  end
15
15
 
16
- # Check Certificate file for iPhone/Apple Development 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?
@@ -33,11 +33,21 @@ module AppleCertsInfo
33
33
  end
34
34
 
35
35
  def self.certificate_development_list
36
- certificate_list_for(name: "Development")
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)
@@ -125,16 +134,14 @@ 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
132
141
  end
133
142
 
134
143
  def self.certificate_list_for(name:)
135
- puts("targetName: #{name}") if @debug_log == true
136
144
  result = `security find-certificate -a -c "#{name}"`
137
- puts(result) if @debug_log == true
138
145
  name_match_list = result.scan(/.*alis".*=\"(.*)\".*/)
139
146
  puts(name_match_list) if @debug_log == true
140
147
 
@@ -1,3 +1,3 @@
1
1
  module AppleCertsInfo
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple_certs_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshiyuki Hirata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-12 00:00:00.000000000 Z
11
+ 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: []