class CuttingEdge::Repository

Constants

DEFAULT_LANG
DEPENDENCY_TYPES

Attributes

auth_token[R]
contact_email[R]
dependency_types[RW]
lang[R]
locations[R]

Public Class Methods

headers(auth_token) click to toggle source
# File lib/cutting_edge/repo.rb, line 86
def headers(auth_token)
  {}
end
new(org:, name:, lang: nil, locations: nil, branch: nil, email: nil, auth_token: nil, hide: nil) click to toggle source
# File lib/cutting_edge/repo.rb, line 91
def initialize(org:, name:, lang: nil, locations: nil, branch: nil, email: nil, auth_token: nil, hide: nil)
  @org     = org
  @name    = name
  @auth_token = auth_token
  @branch  = branch  || 'master'
  @hidden  = hide
  @lang    = lang || DEFAULT_LANG
  @contact_email = email
  @locations = {}
  (locations || get_lang(@lang).locations(name)).each do |loc|
    @locations[loc] = url_for_file(loc)
  end
  @dependency_types = DEPENDENCY_TYPES
end

Public Instance Methods

hidden?() click to toggle source
# File lib/cutting_edge/repo.rb, line 110
def hidden?
  !!@hidden
end
hidden_token() click to toggle source
# File lib/cutting_edge/repo.rb, line 106
def hidden_token
  @hidden
end
identifier() click to toggle source
# File lib/cutting_edge/repo.rb, line 118
def identifier
  File.join(source, @org, @name)
end
source() click to toggle source
# File lib/cutting_edge/repo.rb, line 114
def source
  ''
end
url_for_file(file) click to toggle source
# File lib/cutting_edge/repo.rb, line 126
def url_for_file(file)
  file
end
url_for_project() click to toggle source
# File lib/cutting_edge/repo.rb, line 122
def url_for_project
  ''
end

Private Instance Methods

get_lang(lang) click to toggle source
# File lib/cutting_edge/repo.rb, line 132
def get_lang(lang)
  Object.const_get("::#{lang.capitalize}Lang")
end