Method: Zip::ZipFileSystem::ZipFileNameMapper#expand_path

Defined in:
lib/pik/contrib/zip/zipfilesystem.rb

#expand_path(aPath) ⇒ Object



587
588
589
590
591
592
# File 'lib/pik/contrib/zip/zipfilesystem.rb', line 587

def expand_path(aPath)
  expanded = aPath.starts_with("/") ? aPath : @pwd.ensure_end("/") + aPath
  expanded.gsub!(/\/\.(\/|$)/, "")
  expanded.gsub!(/[^\/]+\/\.\.(\/|$)/, "")
  expanded.empty? ? "/" : expanded
end