class BitbucketPullRequest::Remotes
Public Class Methods
get_remotes_raw()
click to toggle source
# File lib/bitbucket-pull-request/remotes.rb, line 12 def self.get_remotes_raw `git remote -v` end
remote_path()
click to toggle source
# File lib/bitbucket-pull-request/remotes.rb, line 3 def self.remote_path raw = self.get_remotes_raw origin = raw.match(/^origin\s(.+?)\s\(\w+\)$/) || throw('No remote origin') path = origin[1].match(%r{bitbucket\.org/(.+?)\.git}) path ? path[1] : throw('Only works with bitbucket repositories') end