Module: TaskMapper::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 taskmapper
Defined Under Namespace
Classes: Comment, Project, Ticket
Constant Summary collapse
- PROJECT_API =
Rubyzilla::Product
- COMMENT_API =
The comment class for taskmapper-bugzilla
Do any mapping between TaskMapper and your system’s comment model here versions of the ticket.
Rubyzilla::Bug
Class Method Summary collapse
-
.new(auth = {}) ⇒ Object
This is for cases when you want to instantiate using TaskMapper::Provider::Yoursystem.new(auth).
Instance Method Summary collapse
-
#authorize(auth = {}) ⇒ Object
declare needed overloaded methods here.
- #project(*options) ⇒ Object
- #valid? ⇒ Boolean
Class Method Details
.new(auth = {}) ⇒ Object
This is for cases when you want to instantiate using TaskMapper::Provider::Yoursystem.new(auth)
10 11 12 |
# File 'lib/provider/bugzilla.rb', line 10 def self.new(auth = {}) TaskMapper.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 (auth = {}) @authentication ||= TaskMapper::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.login(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(*) unless .empty? Project.find(.first) else super end end |
#valid? ⇒ Boolean
33 34 35 |
# File 'lib/provider/bugzilla.rb', line 33 def valid? Rubyzilla::Bugzilla.logged_in? end |