apple_certs_info 0.1.1 → 0.1.2

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: 9aa7d7c2f0488a86aad43c21f46120626db39ab3bc47c6dae63bbf7d4e7378d4
4
- data.tar.gz: ee260498195f64c8e6c306996533777ca9b63ee95f9a97f2bee815e387c6e6c3
3
+ metadata.gz: 8b2e020de44a15df7d2cbcc0ef9cbdd2b90f1f90eb3fe00510980e18c257826a
4
+ data.tar.gz: 34a87dfd691adbf5d9285ab3e51c330e27c16b0284549e5790bdc3f17e74ca99
5
5
  SHA512:
6
- metadata.gz: 3f3a0818aa78570b003e171a3ec0b4852426f34a25af3376770acbc2590fdbc55a588814f2566f3cd5a212248bf0a68e5c0066b45b70da9249c17a301f72b01c
7
- data.tar.gz: 9a65aeb1448c9ab71499e798a3a4efb4e28396794f2c75d8766423641232e3b6465972f0dd6fa4b50eef2e206fc82ade0604aa423f172b23be82bf40939d0896
6
+ metadata.gz: e4357c2532858119eefdc305ce2751f3fff6e53dfca7f72f216a0dae75a50154ee85a901c4595a215385255a854e3b4872944d78de9367ac009cbe38fcdc0e1a
7
+ data.tar.gz: d2ae4af575d30f61b730fd0a101d1aea44d05b3955810ddcabd883c3bf251953936092c95913cba85b9598d27bd9d12b43fbcf1061b5b89790fa8ecbe37a99be
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- apple_certs_info (0.1.1)
4
+ apple_certs_info (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,25 +3,33 @@ require "time"
3
3
  require "tempfile"
4
4
 
5
5
  module AppleCertsInfo
6
+ @debug_log = false
6
7
  class Error < StandardError; end
7
8
 
9
+ def self.set_debug_log(flag)
10
+ @debug_log = flag
11
+ end
12
+ def self.debug_log
13
+ @debug_log
14
+ end
15
+
8
16
  # Check Certificate file for iPhone/Apple Development in the KeyChain
9
17
  # @param days: limit days
10
- def self.certificate_development_list_limit_days_for(days:, log: false)
18
+ def self.certificate_development_list_limit_days_for(days:)
11
19
  raise "do not set days param" if days.nil?
12
- limit_days_for(days: days, type: "certificate_development", log: log)
20
+ limit_days_for(days: days, type: "certificate_development")
13
21
  end
14
22
 
15
23
  # Check Certificate file for iPhone/Apple Distribution in the KeyChain
16
- def self.certificate_distribution_list_limit_days_for(days:, log: false)
24
+ def self.certificate_distribution_list_limit_days_for(days:)
17
25
  raise "do not set days param" if days.nil?
18
- limit_days_for(days: days, type: "certificate_distribution", log: log)
26
+ limit_days_for(days: days, type: "certificate_distribution")
19
27
  end
20
28
 
21
29
  # Check Provisioning Profiles in the Directory that is ~/Library/MobileDevice/Provisioning Profiles/
22
- def self.provisioning_profile_list_limit_days_for(days:, log: false)
30
+ def self.provisioning_profile_list_limit_days_for(days:)
23
31
  raise "do not set days param" if days.nil?
24
- limit_days_for(days: days, type: "provisioning_profile", log: log)
32
+ limit_days_for(days: days, type: "provisioning_profile")
25
33
  end
26
34
 
27
35
  def self.certificate_development_list
@@ -40,6 +48,7 @@ module AppleCertsInfo
40
48
  begin
41
49
  `security find-certificate -a -c "#{name}" -p > #{temp_pem_file.path}`
42
50
  result = `openssl x509 -text -fingerprint -noout -in #{temp_pem_file.path}`
51
+ puts(result) if @debug_log == true
43
52
 
44
53
  expire_datetime_match = result.match(/.*Not After :(.*)/)
45
54
  raise "not exits expire date" if expire_datetime_match.nil?
@@ -103,7 +112,7 @@ module AppleCertsInfo
103
112
  end
104
113
 
105
114
  private
106
- def self.limit_days_for(days:, type:, log: false)
115
+ def self.limit_days_for(days:, type:)
107
116
  case type
108
117
  when "certificate_development" then
109
118
  list = certificate_development_list
@@ -112,7 +121,7 @@ module AppleCertsInfo
112
121
  when "provisioning_profile" then
113
122
  list = provisioning_profile_list_info
114
123
  end
115
- puts(list) if log == true
124
+ puts(list) if @debug_log == true
116
125
 
117
126
  danger_list = []
118
127
  list.each do |info|
@@ -124,7 +133,8 @@ module AppleCertsInfo
124
133
 
125
134
  def self.certificate_list_for(name:)
126
135
  result = `security find-certificate -a -c "#{name}"`
127
- name_match_list = result.scan(/.*alis"<blob>=\"(.*)\".*/)
136
+ name_match_list = result.scan(/.*alis".*=\"(.*)\".*/)
137
+ puts(name_match_list) if @debug_log == true
128
138
 
129
139
  info = []
130
140
  name_match_list.each do|name_match|
@@ -1,3 +1,3 @@
1
1
  module AppleCertsInfo
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshiyuki Hirata