Module | Trac |
In: |
lib/ticket.rb
lib/wiki.rb lib/query.rb lib/tickets.rb lib/error.rb trac.rb |
This module wraps the XMLRPC interface of trac (trac.edgewall.org/) into a ruby library. You can now easily access trac from any ruby application without having to handle all the (trivial) XMLRPC calls.
Example (receive list of opened tickets):
require 'trac4r/trac' trac = Trac.new "http://dev.example.com/trac/my_awesome_project" trac.tickets.list :include_closed => false #=> [7,9,3,5,14,...]
Receive one single ticket
ticket = trac.tickets.get 9 #=> #<Trac::Ticket:0xb76de9b4 ... > ticket.summary #=> 'foo' ticket.description #=> 'bar'
See documentation for Trac::Ticket for what methods you can call on ticket.
Create a new ticket
trac.tickets.create "summary", "description", :type => 'defect', :version => '1.0', :milestone => 'bug free' #=> 10
summary and description are required, the rest is optional. It can be one of the following: :severity, :milestone, :status, :type, :priority, :version, :reporter, :owner, :cc, :keywords
returns a new instance of Trac::Base
# File trac.rb, line 58 58: def self.new url, user=nil,pass=nil 59: Base.new url,user,pass 60: end