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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pretty_debug.rb +5 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 586a6a3bbcec2fd560dec4af52d338f2f8276b92
4
- data.tar.gz: 29a97950744e70acaf157ea78a7d949d231cd7a0
3
+ metadata.gz: 78a6bf291c03aaf8b1d6d1771d0489b42349e094
4
+ data.tar.gz: 695fa0ae54e2ab95981b178b8e27691fdcc4a0e5
5
5
  SHA512:
6
- metadata.gz: 2c85006d3881f2b1ae1d4b5c767e64b9fdaa3f1f6426bf6ae64171be88292c5ddf97ce763ba1118dabf6d3e488a9e722f62c7dc3b1af85a01d456ef764ea0f12
7
- data.tar.gz: ac303b059e31df106d595778a220477705d86c76bc4a51eb7c6b19fca0b7c3bf661ad1d26bbdd509108531d3ed0c0832c34d6844a69d40bd7f292d52c9ba0094
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(1).dirname) end
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(1).dirname)) end
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(1).dirname), *rest)
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(3)
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.1
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-05 00:00:00.000000000 Z
11
+ date: 2014-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email: []