Class: SemVerComponents::GitHostings::Bitbucket

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

Instance Method Summary collapse

Instance Method Details

#commit_url(git_url, commit_sha) ⇒ Object

Get the URL to a given commit sha

Parameters
  • git_url (String): The git URL

  • commit_sha (String): The commit sha



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

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

#compare_url(git_url, tag_1, tag_2) ⇒ Object

Get the URL to compare 2 tags

Parameters
  • git_url (String): The git URL

  • tag_1 (String): The first tag

  • tag_2 (String): The second tag



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

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