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.3.1 lib/gitlab_git/path_helper.rb
gitlab_git-10.3.0 lib/gitlab_git/path_helper.rb
gitlab_git-10.2.3 lib/gitlab_git/path_helper.rb
gitlab_git-10.2.2 lib/gitlab_git/path_helper.rb
gitlab_git-10.2.1 lib/gitlab_git/path_helper.rb
gitlab_git-10.2.0 lib/gitlab_git/path_helper.rb
gitlab_git-10.1.4 lib/gitlab_git/path_helper.rb
gitlab_git-10.1.3 lib/gitlab_git/path_helper.rb
gitlab_git-10.1.2 lib/gitlab_git/path_helper.rb
gitlab_git-10.1.1 lib/gitlab_git/path_helper.rb
gitlab_git-10.1.0 lib/gitlab_git/path_helper.rb
gitlab_git-10.0.2 lib/gitlab_git/path_helper.rb
gitlab_git-10.0.1 lib/gitlab_git/path_helper.rb
gitlab_git-10.0.0 lib/gitlab_git/path_helper.rb
gitlab_git-9.0.3 lib/gitlab_git/path_helper.rb
gitlab_git-9.0.2 lib/gitlab_git/path_helper.rb
gitlab_git-9.0.1 lib/gitlab_git/path_helper.rb
gitlab_git-9.0.0 lib/gitlab_git/path_helper.rb
gitlab_git-8.2.0 lib/gitlab_git/path_helper.rb
gitlab_git-8.1.0 lib/gitlab_git/path_helper.rb