crash_analysis 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/lib/crash_analysis/version.rb +1 -1
- data/lib/crash_analysis.rb +33 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a61a81ea6144bb12d1ddb53a53b8ad2ca6484dbd
|
4
|
+
data.tar.gz: 8abd6e0b1290275bd0540b329620f8999c2956d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9b6da53043e32047f800f02f84180dd72d7560d07d5a19d3af84331edb5df2da51f3c9257ed7998e73520683963cdf0f6333a8c320b7b28368113bd525e66fd
|
7
|
+
data.tar.gz: 24a5a93dfc9607294ea95c60effecc12928bef6ba9b9d22f41927f6ff43a3e2d520f236b2672ad6b4d4a25dfbe17aabc290eafcfccd7c21570fd8a9b38ef9570
|
data/lib/crash_analysis.rb
CHANGED
@@ -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
|
-
|
23
|
-
|
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
|
-
|
59
|
+
system("echo running...")
|
30
60
|
if File.directory?(filePath)
|
31
61
|
crashFileNames = traverse(filePath)
|
32
62
|
AnalysisLog(crashFileNames)
|