Class: Pathname
Instance Method Summary collapse
- #==(other) ⇒ Object
- #ruby ⇒ Object
- #to_bash ⇒ Object
- #to_ruby ⇒ Object
- #to_s ⇒ Object (also: #to_windows)
- #windows ⇒ Object
Instance Method Details
#==(other) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/pik/core_ext/pathname.rb', line 25 def ==(other) return false unless Pathname === other self_ = self.dup.to_ruby.downcase other = other.dup.to_ruby.downcase self_ == other end |
#ruby ⇒ Object
17 18 19 |
# File 'lib/pik/core_ext/pathname.rb', line 17 def ruby Pathname(self.to_ruby) end |
#to_bash ⇒ Object
13 14 15 |
# File 'lib/pik/core_ext/pathname.rb', line 13 def to_bash @path.tr('\\','/').sub(/^(.):/){|s| "/#{s[0,1].downcase}"} end |
#to_ruby ⇒ Object
9 10 11 |
# File 'lib/pik/core_ext/pathname.rb', line 9 def to_ruby @path.tr('\\','/').sub(/^(.):/){|s| s.upcase } end |
#to_s ⇒ Object Also known as: to_windows
4 5 6 |
# File 'lib/pik/core_ext/pathname.rb', line 4 def to_s @path.tr('/','\\').sub(/^(.):/){|s| s.upcase } end |