Skip to content

Commit 4a3046b

Browse files
committed
(experimental) short path
Show shorter path in some directories. Not sure it is useful or not.
1 parent 15cefb3 commit 4a3046b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/debug/thread_client.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ def short_inspect obj
321321

322322
def pretty_path path
323323
case
324+
when path.start_with?(dir = RbConfig::CONFIG["rubylibdir"] + '/')
325+
path.sub(dir, '$(rubylibdir)/')
326+
when Gem.path.any? do |gp|
327+
path.start_with?(dir = gp + '/gems/')
328+
end
329+
path.sub(dir, '$(Gem)/')
324330
when HOME && path.start_with?(HOME)
325331
path.sub(HOME, '~/')
326332
else

0 commit comments

Comments
 (0)