Class: SemVerComponents::GitHostings::Bitbucket

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

Overview

Plugin providing URLs to a Bitbucket 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



11
12
13
# File 'lib/sem_ver_components/git_hostings/bitbucket.rb', line 11

def commit_url(git_url, commit_sha)
  "#{public_url(git_url)}/commits/#{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



21
22
23
# File 'lib/sem_ver_components/git_hostings/bitbucket.rb', line 21

def compare_url(git_url, tag1, tag2)
  "#{public_url(git_url)}/compare/commits?targetBranch=refs%2Ftags%2F#{tag1}&sourceBranch=refs%2Ftags%2F#{tag2}"
end