pretty_debug 0.8.3 → 0.8.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_debug.rb +7 -4
- 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: 784c8529843a85b62fd9877425a41a5efdf9c698
|
4
|
+
data.tar.gz: 9183c51a16915a4ba0b7c0ffa1b9df8c32d78ca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab6c125442433f32b64180943db982bbf26c108b2eb0245f8025b35dfef4171477d51b967aa59863f362a2fffd776defcd9c223c7639e51a1987de2a57b7d8ba
|
7
|
+
data.tar.gz: 14808933bbbb3e0c41e2e74b58b54671e6a4e31a0aa2ddff57f8f223b05e2cab76b22001788ff0e8c9a1135ddf99752778a0125ed7b7d7c81762ca78e018263c
|
data/lib/pretty_debug.rb
CHANGED
@@ -87,19 +87,22 @@ class Thread::Backtrace::Location
|
|
87
87
|
end
|
88
88
|
|
89
89
|
module Kernel
|
90
|
-
|
90
|
+
# Suppress warning message ("already initialized constants", etc.).
|
91
91
|
def suppress_warning
|
92
92
|
original_verbose, $VERBOSE = $VERBOSE, nil
|
93
93
|
yield
|
94
94
|
.tap{$VERBOSE = original_verbose}
|
95
95
|
end
|
96
96
|
at_exit do
|
97
|
-
|
97
|
+
# Some exceptions (e.g., Sass::SyntaxError) change `$!` to `nil` by calling `backtrace`
|
98
|
+
# on it. Copying below is to retain access to `$!`.
|
99
|
+
$! = e
|
100
|
+
case e
|
98
101
|
when nil, SystemExit, Interrupt
|
99
102
|
else
|
100
103
|
puts \
|
101
|
-
PrettyDebug.message(
|
102
|
-
PrettyDebug.backtrace_locations(
|
104
|
+
PrettyDebug.message(e).bf.color(:red),
|
105
|
+
PrettyDebug.backtrace_locations(e).to_puts
|
103
106
|
end
|
104
107
|
$stderr.reopen(IO::NULL)
|
105
108
|
$stdout.reopen(IO::NULL)
|