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

Version Path
gitlab_git-10.7.0 lib/gitlab_git/path_helper.rb
gitlab_git-10.6.8 lib/gitlab_git/path_helper.rb
gitlab_git-10.6.7 lib/gitlab_git/path_helper.rb
gitlab_git-10.6.6 lib/gitlab_git/path_helper.rb
gitlab_git-10.6.5 lib/gitlab_git/path_helper.rb
gitlab_git-10.6.4 lib/gitlab_git/path_helper.rb
gitlab_git-10.6.3 lib/gitlab_git/path_helper.rb
gitlab_git-10.6.2 lib/gitlab_git/path_helper.rb
gitlab_git-10.6.1 lib/gitlab_git/path_helper.rb
gitlab_git-10.6.0 lib/gitlab_git/path_helper.rb
gitlab_git-10.5.0 lib/gitlab_git/path_helper.rb
gitlab_git-10.4.7 lib/gitlab_git/path_helper.rb
gitlab_git-10.4.6 lib/gitlab_git/path_helper.rb
gitlab_git-10.4.5 lib/gitlab_git/path_helper.rb
gitlab_git-10.4.4 lib/gitlab_git/path_helper.rb
gitlab_git-10.4.3 lib/gitlab_git/path_helper.rb
gitlab_git-10.4.2 lib/gitlab_git/path_helper.rb
gitlab_git-10.4.1 lib/gitlab_git/path_helper.rb
gitlab_git-10.4.0 lib/gitlab_git/path_helper.rb
gitlab_git-10.3.2 lib/gitlab_git/path_helper.rb