Module: Skylab::Myterm::PathPrettifier

Included in:
Cli
Defined in:
lib/myterm/cli.rb

Constant Summary collapse

HOME_DIR_RE =
/\A#{Regexp.escape(ENV['HOME'])}/

Instance Method Summary collapse

Instance Method Details

#pretty_path(path) ⇒ Object



9
10
11
# File 'lib/myterm/cli.rb', line 9

def pretty_path path
  path.sub(HOME_DIR_RE, '~')
end