Module: EacLauncher::Vendor::Github

Defined in:
lib/eac_launcher/vendor/github.rb

Class Method Summary collapse

Class Method Details

.to_ssh_url(url) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/eac_launcher/vendor/github.rb', line 7

def to_ssh_url(url)
  return nil if url.blank?

  url_no_dot_git = url.gsub(/\.git\z/, '')

  m = %r{\Ahttps://github.com/([^/]+)/([^/]+)\z}.match(url_no_dot_git.to_s)
  m ? "[email protected]:#{m[1]}/#{m[2]}.git" : url
end