Module: TicketMaster::Provider::Github

Includes:
Base
Defined in:
lib/provider/github.rb,
lib/provider/project.rb,
lib/provider/comment.rb,
lib/provider/ticket.rb,
lib/github/github.rb

Overview

This is the Github Provider for ticketmaster

Defined Under Namespace

Classes: Comment, GithubComment, Project, Ticket

Constant Summary collapse

PROJECT_API =
Octopi::Repository
ISSUE_API =
Octopi::Issue

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.loginObject

Returns the value of attribute login.



9
10
11
# File 'lib/provider/github.rb', line 9

def 
  @login
end

Class Method Details

.new(auth = {}) ⇒ Object

This is for cases when you want to instantiate using TicketMaster::Provider::Github.new(auth)



13
14
15
# File 'lib/provider/github.rb', line 13

def self.new(auth = {})
  TicketMaster.new(:github, auth)
end

Instance Method Details

#authorize(auth = {}) ⇒ Object

declare needed overloaded methods here



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/provider/github.rb', line 18

def authorize(auth = {})
  @authentication ||= TicketMaster::Authenticator.new(auth)
  auth = @authentication
  if auth.token.nil? or (auth..nil? and auth.username.nil?)
    TicketMaster::Provider::Github. = auth. || auth.username
    return
  else
    Octopi::Api.api = Octopi::AuthApi.instance
    Octopi::Api.api.token = auth.token unless auth.token.blank?
    Octopi::Api.api. = auth. || auth.username
  end
end

#project(*name) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/provider/github.rb', line 39

def project(*name)
  unless name.empty?
    Project.find(name.first)
  else
    super
  end
end

#projects(*options) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/provider/github.rb', line 31

def projects(*options)
  if options.empty?
    PROJECT_API.find(:user => TicketMaster::Provider::Github.).collect{|repo| Project.new repo}
  elsif  options.first.is_a?(Array)
    options.collect{|name| Project.find(name)}.first
  end
end