Class: SemVerComponents::GitHostings::Github

Inherits:
SemVerComponents::GitHosting show all
Defined in:
lib/sem_ver_components/git_hostings/github.rb

Overview

Plugin providing URLs to a GitHub hosting

Instance Method Summary collapse

Instance Method Details

#commit_url(git_url, commit_sha) ⇒ String

Get the URL to a given commit sha

Parameters:

  • git_url (String) —

    The git URL

  • commit_sha (String) —

    The commit sha

Returns:

  • (String) —

    The URL to the commit



10
11
12
# File 'lib/sem_ver_components/git_hostings/github.rb', line 10

def commit_url(git_url, commit_sha)
  "#{git_url}/commit/#{commit_sha}"
end

#compare_url(git_url, tag1, tag2) ⇒ String

Get the URL to compare 2 tags

Parameters:

  • git_url (String) —

    The git URL

  • tag1 (String) —

    The first tag

  • tag2 (String) —

    The second tag

Returns:

  • (String) —

    The URL to compare the 2 tags



20
21
22
# File 'lib/sem_ver_components/git_hostings/github.rb', line 20

def compare_url(git_url, tag1, tag2)
  "#{git_url}/compare/#{tag1}...#{tag2}"
end