Module: Gitlab::RepositoryUrlBuilder

Defined in:
lib/gitlab/repository_url_builder.rb

Class Method Summary collapse

Class Method Details

.build(path, protocol: :ssh) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/gitlab/repository_url_builder.rb', line 6

def build(path, protocol: :ssh)
  # TODO: See https://gitlab.com/gitlab-org/gitlab/-/issues/213021
  path = path.sub('@snippets', 'snippets')

  case protocol
  when :ssh
    ssh_url(path)
  when :http
    http_url(path)
  else
    raise NotImplementedError.new("No URL builder defined for protocol #{protocol}")
  end
end