Module: TaskMapper::Provider::Redmine

Includes:
Base
Defined in:
lib/provider/redmine.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 =
RedmineAPI::Project
TICKET_API =
RedmineAPI::Issue
API =

Ticket class for taskmapper-yoursystem

RedmineAPI::Issue

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(auth = {}) ⇒ Object

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



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

def self.new(auth = {})
  TaskMapper.new(:redmine, auth)
end

Instance Method Details

#authorize(auth = {}) ⇒ Object

declare needed overloaded methods here



14
15
16
17
18
19
20
21
22
# File 'lib/provider/redmine.rb', line 14

def authorize(auth = {})
  @authentication ||= TaskMapper::Authenticator.new(auth)
  auth = @authentication
  if auth.server.blank? and auth.token.blank?
    raise "Please you should provide server and token"
  end

  RedmineAPI.authenticate(auth.server, auth.token)
end

#valid?Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
# File 'lib/provider/redmine.rb', line 24

def valid?
  begin
    RedmineAPI::Project.find(:all).size >= 0 
  rescue
    false
  end
end