Created
August 4, 2009 08:33
-
-
Save hughevans/161109 to your computer and use it in GitHub Desktop.
Convert your Pivotal Tracker iterations to a textile table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 || ' '}|\"##{story.id}\":http://www.pivotaltracker.com/story/show/#{story.id}|\n" | |
textile << "| | | |\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