Sha256: 0e04d6d940e7fdda2778109a5f95f6fd1225bcacb498ab2295a388f61c31476c
Contents?: true
Size: 389 Bytes
Versions: 48
Compression:
Stored size: 389 Bytes
Contents
module Gitlab module Git class PathHelper class << self def normalize_path(filename) # Strip all leading slashes so that //foo -> foo filename[/^\/*/] = '' # Expand relative paths (e.g. foo/../bar) filename = Pathname.new(filename) filename.relative_path_from(Pathname.new('')) end end end end end
Version data entries
48 entries across 48 versions & 1 rubygems