pretty_trace 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pretty_trace.rb +2 -0
- data/lib/pretty_trace/handler.rb +3 -1
- data/lib/pretty_trace/structured_backtrace.rb +7 -1
- data/lib/pretty_trace/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 998231e5021510cf4ddf8970561786c2084624d077a6fc0b7d654d9c2360316b
|
4
|
+
data.tar.gz: 9989169dedbbf6e29396e5e47288b592a9dc39f07226e02e7fb58898c20c2052
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8386fc1d2cfe96262be420d6d9eba16153f343a7077e288fb65d2997c386a8264ecac1b8f89d6e7666880645dd6b5af88ed3a8e79321db1b32e07ee0f7767fd1
|
7
|
+
data.tar.gz: 3122c609e0fff5c96a477523ad740a5c33bab434b32f6639bcbb07c3d9f371085e0fd7b7242156818748bc742e0e4ffb362815d360a446b662eb8bea2003b186
|
data/lib/pretty_trace.rb
CHANGED
data/lib/pretty_trace/handler.rb
CHANGED
@@ -45,7 +45,9 @@ module PrettyTrace
|
|
45
45
|
def show_errors(exception)
|
46
46
|
# :nocov:
|
47
47
|
backtrace = StructuredBacktrace.new exception.backtrace, options
|
48
|
-
|
48
|
+
|
49
|
+
puts "\n#{backtrace}" unless backtrace.empty?
|
50
|
+
|
49
51
|
message = exception.message
|
50
52
|
if message.empty?
|
51
53
|
puts "\n%{blue}#{exception.class}%{reset}\n" % colors
|
@@ -24,7 +24,9 @@ module PrettyTrace
|
|
24
24
|
result.reverse!
|
25
25
|
result.uniq!(&:path) if should_trim? result
|
26
26
|
|
27
|
-
|
27
|
+
if first_line and first_line.original_line != result[-1].original_line
|
28
|
+
result.push first_line
|
29
|
+
end
|
28
30
|
|
29
31
|
result
|
30
32
|
end
|
@@ -37,6 +39,10 @@ module PrettyTrace
|
|
37
39
|
formatted_backtrace.join "\n"
|
38
40
|
end
|
39
41
|
|
42
|
+
def empty?
|
43
|
+
formatted_backtrace.empty?
|
44
|
+
end
|
45
|
+
|
40
46
|
private
|
41
47
|
|
42
48
|
def should_trim?(backtrace)
|
data/lib/pretty_trace/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_trace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Display clean and colorful error messages and backtrace
|
14
14
|
email: db@dannyben.com
|