Git Product home page Git Product logo

trac4r's Introduction

trac4r: Ruby wrapper for the Trac XML-RPC API

Author

Niklas Cathor

Author

David Copeland

License

See LICENSE in source distribution

For more information on the Trac XML-RPC see the plugin’s page on trac-hacks.com

Thanks to the original author, Niklas Cathor, who has done most of the work.

Note that I (David Copeland) will probably not be making more changes to this, as my main reason for picking this up was that I am using Trac where I work. We are moving away from Trac, so I have less need to do anything with this library. If someone is interested in claiming ownership, specifically owning the gem on Gemcutter, just let me know and I’ll hand it over.

Install

# Only if you haven't set up gemcutter yet
sudo gem install gemcutter
sudo gem tumble

# Once Gemcutter is setup
sudo gem install trac4r

Overview

This wraps the Trac XML-RPC plugin.

require 'rubygems'
require 'trac4r'

# Note that you need to point to the XMLRPC root and not the root of the trac web interface
trac = Trac.new("http://www.example.com/trac/project/xmlrpc","username","password")
trac.tickets.list # get all tickets
trac.tickets.get 2334 # Get ticket #2334

Receive one single ticket

ticket = trac.tickets.get 9
ticket.summary #=> 'foo'
ticket.description #=> 'bar'

Scope the ticket

trac.tickets.list :include_closed => false

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

Tickets

Trac’s backbone is tickets. The Tickets class contains many useful methods, but can also run arbitrary queries against Trac using a more Rubyesque syntax:

# Gets all tickets in the "Web" component with a status of either "assigned"
# "accepted", or "new"
available_web_tickets = trac.tickets.query(:component => 'Web', :status => [:assigned,:accepted,:new])

# Ticktes that are not closed
unclosed_tickets = trac.tickets.query(:status => "!closed")

# This is a bit wierd, the "!" in the first element means "none of these values"
not_closed_nor_testing = trac.tickets.query(:status => ["!closed","test"])

:include:trac.rdoc

More Info

trac4r's People

Contributors

csexton avatar davetron5000 avatar jesperronn avatar jrozner avatar madsnielsen avatar pdecourcel avatar

Watchers

 avatar  avatar

Forkers

bwl21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.