Skip to content

Instantly share code, notes, and snippets.

@hone
Created January 20, 2010 23:59
Show Gist options
  • Select an option

  • Save hone/282448 to your computer and use it in GitHub Desktop.

Select an option

Save hone/282448 to your computer and use it in GitHub Desktop.
def commit_path(build)
path = ""
if /github.com/.match(build.project.uri.to_s)
git_uri = build.project.uri.to_s.sub(/git(@|:\/\/)github.com[:\/]/, '').split('/')
project_name = git_uri.last.split('.').first
github_username = git_uri.first
path = "https://github.com/#{github_username}/#{project_name}/commit/#{build.commit.identifier}"
end
path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment