Skip to content

Commit 613474b

Browse files
committed
Added examples from Trac::Ticket to the readme page (gets people started faster
1 parent 1f69a50 commit 613474b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.markdown

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
11
trac4r: Ruby wrapper for the Trac XML-RPC API
22
=============================================
33

4+
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.
45
For more information on the Trac XML-RPC see the [plugin's page on trac-hacks.com](http://trac-hacks.org/wiki/XmlRpcPlugin#UsingfromRuby)
56

67
Thanks to the original author, Niklas Cathor, who has done most of the work.
8+
9+
10+
Examples
11+
==========
12+
13+
Example (receive list of opened tickets):
14+
15+
require 'trac4r/trac'
16+
trac = Trac.new "http://dev.example.com/trac/my_awesome_project"
17+
trac.tickets.list :include_closed => false #=> [7,9,3,5,14,...]
18+
19+
Receive one single ticket
20+
21+
ticket = trac.tickets.get 9 #=> #<Trac::Ticket:0xb76de9b4 ... >
22+
ticket.summary #=> 'foo'
23+
ticket.description #=> 'bar'
24+
25+
See documentation for Trac::Ticket for what methods you can call on ticket.
26+
27+
Create a new ticket
28+
29+
trac.tickets.create "summary", "description", :type => 'defect', :version => '1.0', :milestone => 'bug free' #=> 10
30+
31+
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
32+

0 commit comments

Comments
 (0)