Module: Fancypath::Helpers

Included in:
Pathname, String
Defined in:
lib/fancypath/fancypath.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) to_expanded_fancypath Also known as: p



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

def to_expanded_fancypath
  Fancypath.new File.expand_path(to_tilde_expanded_path)
end

- (Object) to_fancypath



6
7
8
# File 'lib/fancypath/fancypath.rb', line 6

def to_fancypath
  Fancypath.new to_tilde_expanded_path
end

- (Object) to_tilde_expanded_path



12
13
14
# File 'lib/fancypath/fancypath.rb', line 12

def to_tilde_expanded_path
  sub(/^\~\/|^\~$/) {|_| Etc.getpwuid(Process.euid).dir.end_with('/') }
end