crash_analysis 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 1c6570f255ade1e743adf14a7e69b905030863be
4
- data.tar.gz: b053372eac65ecfff07a07e3d2978eb00d999350
3
+ metadata.gz: a61a81ea6144bb12d1ddb53a53b8ad2ca6484dbd
4
+ data.tar.gz: 8abd6e0b1290275bd0540b329620f8999c2956d8
5
5
  SHA512:
6
- metadata.gz: 478e8b96b690e42e61e5518077c21bce371a934b6fa09d4c48c201740465ae86291b17493c38be488b394510078fc7cfa096995fb1a28f37d1edcb60a54e7b34
7
- data.tar.gz: 147076448942573bcd083749b2b3820a90223f94eb4cc3dffdd7f27b4105442fa173f8fecf4cb80c6f4d12d13273103ae00aa55740adb5c5b43f389bf43ba5a7
6
+ metadata.gz: d9b6da53043e32047f800f02f84180dd72d7560d07d5a19d3af84331edb5df2da51f3c9257ed7998e73520683963cdf0f6333a8c320b7b28368113bd525e66fd
7
+ data.tar.gz: 24a5a93dfc9607294ea95c60effecc12928bef6ba9b9d22f41927f6ff43a3e2d520f236b2672ad6b4d4a25dfbe17aabc290eafcfccd7c21570fd8a9b38ef9570
@@ -1,3 +1,3 @@
1
1
  module CrashAnalysis
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -19,14 +19,44 @@ end
19
19
  def AnalysisLog(crashFileNames)
20
20
  cmd = "/Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash"
21
21
  evn = "export DEVELOPER_DIR='/Applications/XCode.app/Contents/Developer'"
22
- for fileName in crashFileNames do
23
- system("#{evn} \n #{cmd} #{fileName}.crash BDPhoneBrowser.app.dSYM > #{fileName}.log")
22
+ crashFileNames.prog_each {
23
+ |fileName|
24
+ system("#{evn} \n #{cmd} #{fileName}.crash BDPhoneBrowser.app.dSYM > #{fileName}.log")
25
+ }
26
+ end
27
+
28
+ class Array
29
+ def prog_each(&block)
30
+ bar_length = (`tput cols` || 80).to_i - 30
31
+ time_now = Time.now
32
+ total = self.count
33
+ last_flush = 0
34
+ flush_time = 1
35
+ self.each_with_index{|element, x|
36
+ cur = (x + 1) * 100 / total
37
+ time_left = (((Time.now - time_now) * (100 - cur)).to_f / cur).ceil
38
+ if (Time.now - last_flush).to_i >= flush_time or time_left < 1
39
+ time_left_graceful = Time.at(time_left).utc.strftime("%H:%M:%S")
40
+ if time_left > 86400
41
+ time_left_graceful = res.split(":")
42
+ time_left_graceful[0] = (time_left_graceful[0].to_i + days * 24).to_s
43
+ time_left_graceful = time_left_graceful.join(":")
44
+ end
45
+ print "\r"
46
+ cur_len = (bar_length * (x + 1)) / total
47
+ print "[" << (["#"] * cur_len).join << (["-"] * (bar_length - cur_len)).join << "] #{cur}% [#{time_left_graceful} left]"
48
+ last_flush = Time.now
49
+ end
50
+ block.call element if block
51
+ }
52
+ puts "\n"
53
+ "Done."
24
54
  end
25
55
  end
26
56
 
27
57
  module CrashAnalysis
28
58
  def self.run(filePath)
29
- puts "Current Dirs:" + filePath
59
+ system("echo running...")
30
60
  if File.directory?(filePath)
31
61
  crashFileNames = traverse(filePath)
32
62
  AnalysisLog(crashFileNames)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crash_analysis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HongliYu