Method: Byebug::Helpers::FileHelper#shortpath

Defined in:
lib/byebug/helpers/file.rb

#shortpath(fullpath) ⇒ Object

A short version of a long path



48
49
50
51
52
53
# File 'lib/byebug/helpers/file.rb', line 48

def shortpath(fullpath)
  components = Pathname(fullpath).each_filename.to_a
  return fullpath if components.size <= 2

  File.join("...", components[-3..-1])
end