pretty_debug 0.4.4 → 0.4.5
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/pretty_debug.rb +11 -9
- 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: ceef4af605293083f91652dc8501ba726c44d085
|
4
|
+
data.tar.gz: 9e342b9316547589ee1fb113e49fd0f4aaf5b1b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcaa139ff74daba43aeb3c2c7aafb384880a4cd5d13e6563791c5d5b21dfd09b2124c47bae60464e9c7d2de8be47ce035a6ee800dde73288e953c0fba87dcf01
|
7
|
+
data.tar.gz: 2286ddcb3c87b4614f11c7542fe51d885bd84554ceb0bc0fe3beeb9b34181e437d6da6749904f4fdfab90f831214297681f5752e5377a3d1372beb5b6df2bb91
|
data/lib/pretty_debug.rb
CHANGED
@@ -146,15 +146,11 @@ class PrettyDebug
|
|
146
146
|
end
|
147
147
|
def self.backtrace_locations e
|
148
148
|
e.complement_backtrace_locations
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
m =~ /\A<.*>\z/ # Such as `<top (required)>`, `<module:Foo>`.
|
154
|
-
end rescue nil
|
155
|
-
PrettyArray.new(a)
|
149
|
+
PrettyArray.new(beautify(e.backtrace_locations))
|
150
|
+
end
|
151
|
+
def self.caller_locations
|
152
|
+
PrettyArray.new(beautify(Kernel.caller_locations))
|
156
153
|
end
|
157
|
-
def self.caller_locations; PrettyArray.new(beautify(Kernel.caller_locations)) end
|
158
154
|
Hook = %w[
|
159
155
|
initialize
|
160
156
|
method_missing
|
@@ -174,7 +170,7 @@ class PrettyDebug
|
|
174
170
|
intitialize_dup
|
175
171
|
]
|
176
172
|
def self.beautify a
|
177
|
-
a
|
173
|
+
a = a
|
178
174
|
.map{|l| [l.absolute_path, l.lineno, l.label]}
|
179
175
|
.transpose.tap do |_, _, ms|
|
180
176
|
ms.map! do |m|
|
@@ -187,6 +183,12 @@ class PrettyDebug
|
|
187
183
|
end
|
188
184
|
ms[-1] = ""; ms.rotate!(-1)
|
189
185
|
end.transpose
|
186
|
+
a.reject! do |f, l, m|
|
187
|
+
@ignore.call(f, m) or
|
188
|
+
f == __FILE__ or
|
189
|
+
m =~ /\A<.*>\z/ # Such as `<top (required)>`, `<module:Foo>`.
|
190
|
+
end rescue nil
|
191
|
+
a
|
190
192
|
end
|
191
193
|
end
|
192
194
|
|