class Ghit::SshGlobals

Attributes

author[R]
repository[R]
url[R]

Public Class Methods

new(remote) click to toggle source
# File lib/ghit/ssh_globals.rb, line 6
def initialize remote
  @remote       = remote
  @author       = extract_author
  @repository   = extract_repository
  @url          = extract_url
end

Private Instance Methods

extract_author() click to toggle source
# File lib/ghit/ssh_globals.rb, line 19
def extract_author 
  @remote.split[-2].split("/")[0].split(":")[-1]
end
extract_repository() click to toggle source
# File lib/ghit/ssh_globals.rb, line 23
def extract_repository
  @remote.scan(/\/(.*).git/).join
end
extract_url() click to toggle source
# File lib/ghit/ssh_globals.rb, line 15
def extract_url
  "https://github.com/#{@author}/#{@repository}"
end