certstepper 1.1.3 → 1.1.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/certstepper.rb +15 -11
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b20b0c5bf7433d5abf30aa4a910a2ab58cf1d33
4
- data.tar.gz: 535389d69c1aa5acd381e97c284617f5253ffe6f
3
+ metadata.gz: d79605fedd8df288f566664fd269a516bea782ea
4
+ data.tar.gz: a5fea3b5b2ee819702b93befaec705b18823f7f5
5
5
  SHA512:
6
- metadata.gz: 206e93a58d081b5985f4c13df89fc296908b8fece244af2216bf595b8d50e9f663c92e81aa69823d43dafc303bc7d85d4c77e362ae87c361536a5bbd71e4187f
7
- data.tar.gz: bfdee98c951cc1a91ea5f611a83fb31a486e8115df480179a7984e884d76433e43a70ea1c3605fa35e703aaf07a0023b098b62c2ea6911eb95bc77411cb6d2dd
6
+ metadata.gz: 40915f36c73f9f45ccf0115d04af05916d398e31af8870f6ac95768b4522897b6a1114343f0a82153f3b1d0841a365512932ebcf891d782c7b1610da783a1c96
7
+ data.tar.gz: 4e3e1bc30fe3c99965cb982e4be32e5bd8ec2a248cc2ec8e0926028405bea1ef7a0d50a143c2b26e6a0ba9476ff7cdfaa9cc7761a513de95f2e12dbb0501d60e
data/lib/certstepper.rb CHANGED
@@ -34,8 +34,7 @@ module CertStepper
34
34
  # end
35
35
 
36
36
 
37
- file = File.open("#{File.expand_path('~')}/certstepper.log", "w")
38
- file.write("#{ARGV}\n")
37
+ self.logMessage("#{ARGV}\n")
39
38
 
40
39
  begin
41
40
  if ARGV[0].start_with? "chrome-extension:"
@@ -44,17 +43,17 @@ module CertStepper
44
43
  str = self.getUserInput[1..-1]
45
44
  str =str.strip_control_characters
46
45
 
47
- file.write("#{str}\n")
46
+ self.logMessage("#{str}\n")
48
47
 
49
48
 
50
- file.write "start parse #{str.class}\n"
49
+ self.logMessage "start parse #{str.class}\n"
51
50
  my_hash = JSON.parse str
52
- file.write("end parse#{my_hash}\n")
51
+ self.logMessage("end parse#{my_hash}\n")
53
52
 
54
53
  start_path = my_hash["start_path"]
55
- profile_name = my_hash["name"]
54
+ profile_name = my_hash["profile_name"]
56
55
  if start_path
57
- file.write("#start work \n")
56
+ self.logMessage("#start work start_path:#{start_path} : #{profile_name} \n")
58
57
  self.startWorkByChromeExtension start_path , profile_name
59
58
  finished = true
60
59
  end
@@ -65,19 +64,17 @@ module CertStepper
65
64
  end
66
65
 
67
66
  rescue => e
68
- f.write e.backtrace
67
+ self.logMessage e.backtrace
69
68
  end
70
69
 
71
70
 
72
- file.close
73
71
  end
74
72
 
75
73
  def self.startWorkByChromeExtension(root_path,profile_name)
76
- file = File.open("/Users/mac/Desktop/CertSimplify/some_file", "a")
77
74
  console_root_path = root_path.gsub /[\s]/ , "\\ "
78
75
  system("open #{console_root_path}")
79
76
  self.createDir root_path + "/#{profile_name}"
80
- self.dealCertByChrome root_path , profile_name
77
+ #self.dealCertByChrome root_path , profile_name
81
78
  mobileprovision_name = "#{profile_name}.mobileprovision"
82
79
  source_file = "#{File.expand_path('~')}/Downloads/#{mobileprovision_name}"
83
80
  dest_file = "#{root_path}/#{profile_name}/#{mobileprovision_name}"
@@ -198,4 +195,11 @@ module CertStepper
198
195
  system "security delete-keychain 123456"
199
196
  end
200
197
 
198
+
199
+ def self.logMessage(message)
200
+ file = File.open("#{File.expand_path('~')}/certstepper.log", "w+")
201
+ file.write message
202
+ file.close
203
+ end
204
+
201
205
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: certstepper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - chengkai