Module: TicketMaster::Provider::Bugzilla

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

Overview

This is the Yoursystem Provider for ticketmaster

Defined Under Namespace

Classes: Comment, Project, Ticket

Constant Summary collapse

PROJECT_API =
Rubyzilla::Product
COMMENT_API =

The comment class for ticketmaster-bugzilla

Do any mapping between Ticketmaster and your system’s comment model here versions of the ticket.

Rubyzilla::Bug

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(auth = {}) ⇒ Object

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



10
11
12
# File 'lib/provider/bugzilla.rb', line 10

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

Instance Method Details

#authorize(auth = {}) ⇒ Object

declare needed overloaded methods here



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/provider/bugzilla.rb', line 15

def authorize(auth = {})
  @authentication ||= TicketMaster::Authenticator.new(auth)
  auth = @authentication
  if (auth.username.nil? || auth.url.nil? || auth.password.nil?)
    raise "Please provide username, password and url"
  end
  url = auth.url.gsub(/\/$/,'')
  unless url.split('/').last == 'xmlrpc.cgi'
    auth.url = url+'/xmlrpc.cgi'
  end
  @bugzilla = Rubyzilla::Bugzilla.new(auth.url)
  begin
    @bugzilla.(auth.username,auth.password)
  rescue
    warn 'Authentication was invalid'
  end
end

#project(*options) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/provider/bugzilla.rb', line 37

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

#valid?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/provider/bugzilla.rb', line 33

def valid?
  Rubyzilla::Bugzilla.logged_in?
end