pretty_debug 0.7.9 → 0.8.0
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 +14 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4eb2479421003f23c8c72079d607afd7afe1a660
|
4
|
+
data.tar.gz: 15d229e88a27bf18e338da9f783b97e94c5782f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1d4d1f9a7f0c74d970134b2a05c025627abfbb09877efb5856c8a21b8520c7440a6399bd1ed5cb4af4092f8137202cfeb72dfc3f3fb4b3587703bad32709ef5
|
7
|
+
data.tar.gz: 77f513bdb964b6aab49ae9119baef0db40a826c26d45d6052e5d83d91ddef3743493d4d51b6cd040eb4bc741c002294fddb964b2599e36fec100219df6e9b9bf
|
data/lib/pretty_debug.rb
CHANGED
@@ -5,16 +5,16 @@
|
|
5
5
|
#############################################
|
6
6
|
|
7
7
|
class File
|
8
|
-
def self.expand_path_relative f; expand_path(f, caller_location.
|
8
|
+
def self.expand_path_relative f; expand_path(f, caller_location.realdirname) end
|
9
9
|
end
|
10
10
|
|
11
11
|
class Dir
|
12
|
-
def self.glob_relative f; glob(File.expand_path(f, caller_location.
|
12
|
+
def self.glob_relative f; glob(File.expand_path(f, caller_location.realdirname)) end
|
13
13
|
end
|
14
14
|
|
15
15
|
module Kernel
|
16
16
|
def caller_location i = 1; caller_locations(i + 1, 1).first end
|
17
|
-
def load_relative f, *rest; load(File.expand_path(f, caller_location.
|
17
|
+
def load_relative f, *rest; load(File.expand_path(f, caller_location.realdirname), *rest) end
|
18
18
|
end
|
19
19
|
|
20
20
|
#############################################
|
@@ -71,11 +71,19 @@ class Thread::Backtrace::PseudoLocation
|
|
71
71
|
@path = File.basename(@absolute_path)
|
72
72
|
@base_label = @label
|
73
73
|
end
|
74
|
+
def dirname; File.dirname(absolute_path) end
|
75
|
+
def basename; File.basename(absolute_path) end
|
76
|
+
def realpath; File.realpath(absolute_path) end
|
77
|
+
def realdirname; File.dirname(realpath) end
|
78
|
+
def realbasename; File.basename(realpath) end
|
74
79
|
end
|
75
80
|
|
76
81
|
class Thread::Backtrace::Location
|
77
|
-
def dirname; File.dirname(
|
78
|
-
def basename; File.basename(
|
82
|
+
def dirname; File.dirname(absolute_path) end
|
83
|
+
def basename; File.basename(absolute_path) end
|
84
|
+
def realpath; File.realpath(absolute_path) end
|
85
|
+
def realdirname; File.dirname(realpath) end
|
86
|
+
def realbasename; File.basename(realpath) end
|
79
87
|
end
|
80
88
|
|
81
89
|
module Kernel
|
@@ -153,7 +161,7 @@ class PrettyDebug
|
|
153
161
|
]
|
154
162
|
def self.beautify a
|
155
163
|
a = a
|
156
|
-
.map{|l| [l.
|
164
|
+
.map{|l| [l.realpath, l.lineno, l.label]}
|
157
165
|
.transpose.tap do |_, _, ms|
|
158
166
|
ms.map! do |m|
|
159
167
|
case m
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pretty_debug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email: []
|