Sha256: 02a2400970c342611eee2474bdd97ee8cc72368dc752aff09048dc61f10c4022

Contents?: true

Size: 440 Bytes

Versions: 10

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true
class GitlabURLParser < URLParser
  private

  def full_domain
    'https://gitlab.com'
  end

  def tlds
    %w(com)
  end

  def domain
    'gitlab'
  end

  def remove_domain
    # find the matches for any github domain characters in the url string
    # and replace only the first match incase we find a repo with something like github.com as the name
    url.sub!(/(gitlab\.com)+?(:|\/)?/i, '')
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
librariesio-url-parser-1.0.10 lib/gitlab_url_parser.rb
librariesio-url-parser-1.0.9 lib/gitlab_url_parser.rb
librariesio-url-parser-1.0.8 lib/gitlab_url_parser.rb
librariesio-url-parser-1.0.7 lib/gitlab_url_parser.rb
librariesio-url-parser-1.0.6 lib/gitlab_url_parser.rb
librariesio-url-parser-1.0.5 lib/gitlab_url_parser.rb
librariesio-url-parser-1.0.4 lib/gitlab_url_parser.rb
librariesio-url-parser-1.0.3 lib/gitlab_url_parser.rb
librariesio-url-parser-1.0.2 lib/gitlab_url_parser.rb
librariesio-url-parser-1.0.1 lib/gitlab_url_parser.rb