class GitSnatch::Url

Attributes

location[R]
repo[R]
sha[R]

Public Class Methods

new(repo, sha, location) click to toggle source
# File lib/git_snatch/url.rb, line 3
def initialize(repo, sha, location)
  @repo = repo
  @sha = sha
  @location = location
end

Public Instance Methods

full() click to toggle source
# File lib/git_snatch/url.rb, line 9
def full
  elements.join('/')
end

Private Instance Methods

base() click to toggle source
# File lib/git_snatch/url.rb, line 32
def base
  GitSnatch.configuration.endpoint
end
elements() click to toggle source
# File lib/git_snatch/url.rb, line 16
def elements
  [ base, username, repo, mode, sha, location ].compact
end
github?() click to toggle source
# File lib/git_snatch/url.rb, line 24
def github?
  base.include?('raw')
end
mode() click to toggle source
# File lib/git_snatch/url.rb, line 20
def mode
  'raw' unless github?
end
username() click to toggle source
# File lib/git_snatch/url.rb, line 28
def username
  GitSnatch.configuration.username if github?
end