Skip to content

Instantly share code, notes, and snippets.

@cbrunnkvist
Created April 28, 2010 11:23
Show Gist options
  • Save cbrunnkvist/382023 to your computer and use it in GitHub Desktop.
Save cbrunnkvist/382023 to your computer and use it in GitHub Desktop.
<% iterations.each do |iteration| %>
<h2 id='Sprint_<%= iteration.number %>' style='display:inline'>Sprint <%= iteration.number %></h2><i> - ends <%= iteration.finish.strftime("%Y-%m-%d") %></i><a href='#Sprint_<%= iteration.number %>' class='anchor'>&nbsp;&para;</a>
<ul>
<% iteration.stories.each do |story| %>
<li class='story'><h3 style='display:inline'><i>Story <%= story.id %> (<%= story.current_state %>)</i></h3>
<small class='taskCount'><i><%= " - #{story.tasks.size} tasks defined" if story.respond_to?(:tasks) %></i></small>
<p class='storyDescription'><span class="storyIngress"><%= story.name%></span><br><span class="storyRest" style="color:grey"></span></p>
<% end %>
</ul>
<% end %>
#!/usr/bin/env ruby
require 'rubygems'
require 'active_resource'
require 'erb'
class Iteration < ActiveResource::Base
self.site = "http://www.pivotaltracker.com/services/v3/projects/:project_id"
self.proxy = ENV["HTTP_PROXY"] if ENV["HTTP_PROXY"]
headers['X-TrackerToken'] = '1234567890acbdef1234567890acbdef'
end
PROJECT_ID = ARGV[0]
raise ArgumentError.new('Please specify project id (like "64534")') if PROJECT_ID.nil?
current_iteration = Iteration.find(:all, :params => {:project_id => PROJECT_ID, :group => "current"})
iterations_backlog = Iteration.find(:all, :params => {:project_id => PROJECT_ID, :group => "backlog"})
iterations = current_iteration + iterations_backlog
tpl = ERB.new(File.read( "#{File.expand_path(File.dirname($0))}/iterations.erb" ))
puts tpl.result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment