Module: OpenGit::Open

Defined in:
lib/open_git/open.rb

Class Method Summary collapse

Class Method Details

.github(remote = nil) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/open_git/open.rb', line 3

def self.github(remote = nil)
  raise OpenGit::Git::NoGitRepoError unless OpenGit::Git.is_git_repo
  match = OpenGit::Github.parse(OpenGit::Git.url(remote))
  protocol = match[:protocol]
  protocol = "https" if protocol == "ssh"
  "#{protocol}://#{match[:domain]}/#{match[:org]}/#{match[:repo]}"
end

.github_pull_request(remote = nil) ⇒ Object



11
12
13
# File 'lib/open_git/open.rb', line 11

def self.github_pull_request(remote = nil)
  "#{self.github(remote)}/pull/#{OpenGit::Git.branch}"
end