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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pretty_debug.rb +14 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e16dfe21c7b021f09ce23e66214278153ac9a589
4
- data.tar.gz: 944d40f22f9622567fdacb8010283ea77cd53b07
3
+ metadata.gz: 4eb2479421003f23c8c72079d607afd7afe1a660
4
+ data.tar.gz: 15d229e88a27bf18e338da9f783b97e94c5782f2
5
5
  SHA512:
6
- metadata.gz: e2d6038072c8b303fb0c3239bad0eaaaacc07263712d7c6867704c0585b2d908f7a9230b8c64c85deadd0d5022c14b8cccc5428f6f208fd4c9e47229e667f238
7
- data.tar.gz: a3e85fa576ee948b708fe3027fc41f4b857555ac232a753f86ebbf6a82e135ff6201dd41e6841094242f3b016c32b9fa185a6be34abc5c4dfbc690f18b043aa9
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.dirname) end
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.dirname)) end
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.dirname), *rest) end
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(path) end
78
- def basename; File.basename(path) end
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.absolute_path, l.lineno, l.label]}
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.7.9
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-04 00:00:00.000000000 Z
11
+ date: 2014-03-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email: []