pretty_debug 0.6.1 → 0.6.2
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 +5 -5
- 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: 78a6bf291c03aaf8b1d6d1771d0489b42349e094
|
4
|
+
data.tar.gz: 695fa0ae54e2ab95981b178b8e27691fdcc4a0e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 308ec46274e44479618d9bc6cb24b3a7a80c3078368bdbf9ab53da6693634ccf01f0b6f30f66177946636f0d2a9b9c131bada7a6eabfa5b917b46bffadf5f956
|
7
|
+
data.tar.gz: 08bb983e5233c72c9c4b1a58e17f4b645d6a295ef288b1002af861016787d822bc5be78b0d889458009b95d458c99168d7cebc1aab8e2fddf662ace66af652c1
|
data/lib/pretty_debug.rb
CHANGED
@@ -8,7 +8,7 @@ require "compact_time"
|
|
8
8
|
|
9
9
|
class File
|
10
10
|
def self.relativize f; f.sub(%r{\A/}, "".freeze) end
|
11
|
-
def self.expand_path_relative f; expand_path(f, caller_location
|
11
|
+
def self.expand_path_relative f; expand_path(f, caller_location.dirname) end
|
12
12
|
def self.add f, s
|
13
13
|
open(f, "a+".freeze) do |io|
|
14
14
|
io.readlines.last.tap{|l| io.puts if l && l.end_with?($/).!}
|
@@ -18,13 +18,13 @@ class File
|
|
18
18
|
end
|
19
19
|
|
20
20
|
class Dir
|
21
|
-
def self.glob_relative f; glob(File.expand_path(f, caller_location
|
21
|
+
def self.glob_relative f; glob(File.expand_path(f, caller_location.dirname)) end
|
22
22
|
end
|
23
23
|
|
24
24
|
module Kernel
|
25
|
-
def caller_location i; caller_locations(i + 1, 1).first end
|
25
|
+
def caller_location i = 1; caller_locations(i + 1, 1).first end
|
26
26
|
def load_relative f, *rest;
|
27
|
-
load(File.expand_path(f, caller_location
|
27
|
+
load(File.expand_path(f, caller_location.dirname), *rest)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -255,7 +255,7 @@ end
|
|
255
255
|
|
256
256
|
class Object
|
257
257
|
def intercept &pr
|
258
|
-
l = caller_location
|
258
|
+
l = caller_location
|
259
259
|
tap do |x| puts \
|
260
260
|
"[Debug] #{"#{l.path}:#{l.lineno}"}".color(:yellow),
|
261
261
|
(pr ? pr.call(x) : x).inspect.verbatim.unchomp
|
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.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email: []
|