Skip to content

Instantly share code, notes, and snippets.

@hughevans
Created August 4, 2009 08:33
Show Gist options
  • Save hughevans/161109 to your computer and use it in GitHub Desktop.
Save hughevans/161109 to your computer and use it in GitHub Desktop.
Convert your Pivotal Tracker iterations to a textile table
require 'rubygems'
require 'activeresource'
PROJECT_ID = 123
TOKEN = 'token'
class Iteration < ActiveResource::Base
self.site = "http://www.pivotaltracker.com/services/v2/projects/#{PROJECT_ID}"
headers['X-TrackerToken'] = TOKEN
end
Iteration.find(:all).each do |iteration|
textile = "Iteration #{iteration.number}\n\n"
textile << "{background:#ddd}. |Title|Description|Tracker|\n"
last = iteration.stories.size - 1
iteration.stories.each_with_index do |story, index|
textile << "|#{story.name}|#{story.description || '&nbsp;'}|\"##{story.id}\":http://www.pivotaltracker.com/story/show/#{story.id}|\n"
textile << "|&nbsp;|&nbsp;|&nbsp;|\n" unless last == index
end
textile << "\n\n"
puts textile
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment