# Rake tasks for Trac?

**URL:** <https://www.ruby-forum.com/t/rake-tasks-for-trac/96281>\
**Category:** Ruby\
**Created:** [June 27, 2006, 10:22pm UTC](https://www.ruby-forum.com/t/rake-tasks-for-trac/96281 "2006-06-27T22:22:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [June 27, 2006, 10:22pm UTC](https://www.ruby-forum.com/t/rake-tasks-for-trac/96281/1 "2006-06-27T22:22:47Z")

</div>

Before I reinvent too many wheels, has anyone cooked up, or know about,  
handy Rake tasks for interacting with Trac?

Thanks!

(BTW, I did a Google of “Ruby Rake task cookbook”, and was surprised not  
to find a Rake task cookbook site anyplace. )

–  
James B.

“Take eloquence and wring its neck.”

- Paul Verlaine

---

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [June 27, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/rake-tasks-for-trac/96281/2 "2006-06-27T22:53:17Z")

</div>

James B. wrote:

> Before I reinvent too many wheels, has anyone cooked up, or know about,  
> handy Rake tasks for interacting with Trac?
> 
> Thanks!
> 
> (BTW, I did a Google of “Ruby Rake task cookbook”, and was surprised not  
> to find a Rake task cookbook site anyplace. )
> 
> –  
> James B.
> 
> “Take eloquence and wring its neck.”
> 
> - Paul Verlaine

I haven’t but I’m curious?

Which Trac tasks would you want to use through rake?

---

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [June 27, 2006, 11:20pm UTC](https://www.ruby-forum.com/t/rake-tasks-for-trac/96281/3 "2006-06-27T23:20:54Z")

</div>

James B. wrote:

> (BTW, I did a Google of “Ruby Rake task cookbook”, and was surprised not  
> to find a Rake task cookbook site anyplace. )

This is an excellent idea … I’ve started a page here:  
[http://wikis.onestepback.org/Rake/page/show/TaskCookbook](http://wikis.onestepback.org/Rake/page/show/TaskCookbook)

---

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [June 28, 2006, 1:36am UTC](https://www.ruby-forum.com/t/rake-tasks-for-trac/96281/4 "2006-06-28T01:36:46Z")

</div>

Jim W. wrote:

> James B. wrote:
> 
> > (BTW, I did a Google of “Ruby Rake task cookbook”, and was surprised not  
> > to find a Rake task cookbook site anyplace. )
> 
> This is an excellent idea … I’ve started a page here:  
> [http://wikis.onestepback.org/Rake/page/show/TaskCookbook](http://wikis.onestepback.org/Rake/page/show/TaskCookbook)

Cool.

I’ve a hacky task that adds a new ticket via HTTP post. I want to poke  
it a bit more, shake out the critters with more real-world usage, and  
then I’ll add it.

Thanks for Rake.

–  
James B.

“Judge a man by his questions, rather than his answers.”

- Voltaire

---

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [June 28, 2006, 2:54am UTC](https://www.ruby-forum.com/t/rake-tasks-for-trac/96281/5 "2006-06-28T02:54:14Z")

</div>

Michael G. wrote:

> > 
> 
> Which Trac tasks would you want to use through rake?

Adding tickets, for one thing.

I want to (and, as of 1 hour ago, I can) run

rake trac:post\_task

and answer a few prompts (summary, description, ticket type [defaults  
to task] )

and have a new ticket created in Trac.

Or run

rake trac:tickets\_for james

and get back a plain-text list of open tickets assigned to me.

The first I can now do. The second is not a big need (I just made it  
up, actually), but reasonably useful, and easy enough to code (pulling  
stuff from Trac is easier than pushing).

It would be more interesting if I could query for tickets that way, see  
if there are any tickets related to something or other (tag/keyword  
search), and then add a ticket if I need to.

These are the sorts of little things that I’d like to do from the  
command line while working, to avoid the psychic disruption of clicking  
around a Web page.

–  
James B.

“I was born not knowing and have had only a little  
time to change that here and there.”

- Richard P. Feynman

---

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [July 2, 2006, 11:22pm UTC](https://www.ruby-forum.com/t/rake-tasks-for-trac/96281/6 "2006-07-02T23:22:37Z")

</div>

On Jun 27, 2006, at 1:19 PM, James B. wrote:

> Before I reinvent too many wheels, has anyone cooked up, or know  
> about, handy Rake tasks for interacting with Trac?

I’ve worked with tying a Rails app to Trac in a number of ways,  
mostly to get user comments and errors sent straight to Trac instead  
of my inbox or a logfile I forget to check.

It’s pretty easy with the XML-RPC plugin. ([http://www.trac-hacks.org/](http://www.trac-hacks.org/)  
wiki/XmlRpcPlugin). Two caveats though:

1. you need to get a new version of Trac from their SVN, it’s not  
compatible with the 0.9 series.
2. you need to hack the library slightly. it does content auto-  
detection to on the URL in Trac and routes you to the XML-RPC  
machinery if you’re posting XML otherwise it gives you a _very_ nice  
HTML page detailing the API. ([http://www.trac-hacks.org/ticket/411](http://www.trac-hacks.org/ticket/411))

Let me know if you have any questions about how I set it up.

HTH,  
-Dane

---

<div class="post-metadata">

**Author:** ![byrnejb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d2c977/32.png) [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Post date:** [July 3, 2006, 12:12am UTC](https://www.ruby-forum.com/t/rake-tasks-for-trac/96281/7 "2006-07-03T00:12:07Z")

</div>

Dane J. wrote:

> Let me know if you have any questions about how I set it up.  
> I looked at the Trac XML-RPC a bit, and decided against trying to  
> upgrade my Trac installation. It might make certain things simpler, but  
> POSTing content with authenticated HTTP requests works fine right now.

(I now have useful code for posting new tickets and fetching a list of  
open tickets.)

–  
James B.

[http://www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
[Ruby Code & Style](http://www.artima.com/rubycs/) - The Journal By & For Rubyists  
[http://www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff  
[http://yourelevatorpitch.com](http://yourelevatorpitch.com) - Finding Business Focus
