Class: Gitti::GitHubRepo

Inherits:
Object
  • Object
show all
Defined in:
lib/gitti/base.rb

Overview

or Git::GitHub or Git::Source::GitHub or such - why? why not?

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, name) ⇒ GitHubRepo

Returns a new instance of GitHubRepo.



32
33
34
35
# File 'lib/gitti/base.rb', line 32

def initialize( owner, name )
  @owner = owner    ## use/rename to login or something - why? why not??
  @name  = name     #  e.g. "rubylibs/webservice"
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



30
31
32
# File 'lib/gitti/base.rb', line 30

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner.



30
31
32
# File 'lib/gitti/base.rb', line 30

def owner
  @owner
end

Instance Method Details

#http_clone_urlObject

use clone_url( http: true ) – why? why not?



44
45
46
47
# File 'lib/gitti/base.rb', line 44

def http_clone_url   ## use clone_url( http: true )  -- why? why not?
   ##  note: https is default for github - http:// gets redirected to https://
   "http://github.com/#{@owner}/#{@name}"
end

#https_clone_urlObject



49
50
51
# File 'lib/gitti/base.rb', line 49

def https_clone_url
  "https://github.com/#{@owner}/#{@name}"
end

#ssh_clone_urlObject



38
39
40
41
42
# File 'lib/gitti/base.rb', line 38

def ssh_clone_url
   ##  check: use https: as default? for github - http:// still supported? or redirected?
   ## "http://github.com/#{@owner}/#{@name}"
   "[email protected]:#{@owner}/#{@name}.git"
end