pretty_debug 0.7.6 → 0.7.7
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 +6 -5
- 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: 5b908f1252680196153024b01e285bdaeb79e253
|
4
|
+
data.tar.gz: d54330f760d904f84e18515d6edfdda65aa6577c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c31bc889af761891d8041170f5daa52c33faeeac225bd3094af376308377e3698065204fc841ebd04289f83f4d2889f5ffae805a909fbc1c7e03924b3ef4c662
|
7
|
+
data.tar.gz: eb408d027056deb394af766960333f8e166d8324cb05007cf2458dcad2715bc1800327b8a8e32bff097d4d29b818692d9fc57c18c0cd2ba1dcb9d950af164458
|
data/lib/pretty_debug.rb
CHANGED
@@ -24,17 +24,18 @@ end
|
|
24
24
|
class Object
|
25
25
|
def intercept
|
26
26
|
l = caller_location
|
27
|
-
tap do
|
27
|
+
tap do puts \
|
28
28
|
"[Debug] #{"#{l.path}:#{l.lineno}"}".bf.color(:yellow),
|
29
|
-
|
29
|
+
inspect.verbatim
|
30
30
|
end
|
31
31
|
end
|
32
32
|
def which m
|
33
33
|
l = caller_location
|
34
34
|
m = :method_missing unless self.class.method_defined?(m)
|
35
|
-
|
35
|
+
mt = method(m)
|
36
|
+
tap do puts \
|
36
37
|
"[Debug] #{"#{l.path}:#{l.lineno}"}".bf.color(:yellow),
|
37
|
-
"#{
|
38
|
+
"#{self.class}(#{mt.owner})##{m}@#{mt.source_location.to_a.join(":")}"
|
38
39
|
end
|
39
40
|
end
|
40
41
|
end
|
@@ -45,7 +46,7 @@ module Kernel
|
|
45
46
|
when *klass
|
46
47
|
else
|
47
48
|
ArgumentError.raise(
|
48
|
-
"#{pr.call + " " if pr}should be #{klass.map(&:expand).join(", ")} instance"\
|
49
|
+
"#{pr.call + " " if pr}should be #{klass.map(&:expand).join(", ")} instance "\
|
49
50
|
"but is #{v.expand}")
|
50
51
|
end
|
51
52
|
end
|