Method: FileSystem::Path#absolute
- Defined in:
- lib/filesystem.rb
#absolute ⇒ Object
324 325 326 327 328 329 330 331 332 333 |
# File 'lib/filesystem.rb', line 324 def absolute if self =~ %r{^\w} Path.new( File.join( self.class.getwd, self ) ) else new_str = self.to_s new_str.gsub!( %r{^\.\.}, self.class.getwd + '/..' ) new_str.gsub!( %r{^\.}, self.class.getwd ) Path.new( new_str ) end end |