Skip to content

Instantly share code, notes, and snippets.

View lanej's full-sized avatar
😜

Josh Lane lanej

😜
View GitHub Profile
@lanej
lanej / pivotal_report.rb
Created November 13, 2012 00:02 — forked from ey-pairing/pivotal_report.rb
pivotal report
require 'pivotal'
client = Pivotal::Client.new
report_file = File.expand_path("~/pivotal-report.txt")
File.open(report_file, "w") do |fs|
current_iteration = client.projects.get(635517).iterations.current
fs.puts "Iteration ##{current_iteration.number}, #{current_iteration.start} - #{current_iteration.finish} : #{current_iteration.team_strength * 100.0}%"
current_iteration.stories.each do |story|
fs.puts([story.story_type.capitalize, story.name.inspect, story.url].join(", "))
end
@lanej
lanej / dumpit.rb
Created April 17, 2012 04:16 — forked from ey-pairing/dumpit.rb
DataMapper Schema dump
DataMapper::Model.descendants.each do |model|
puts "create_table :#{model.storage_names[:default]} do"
model.properties.each do |property|
options = property.options.slice(:length)
primitive = property.primitive === Class ? String : property.primitive
puts " column :#{property.name}, DataMapper::Property::#{primitive.to_s}#{"," + options.map{|k,v| "#{k}: #{v}"}.join(", ") unless options.empty?}"
end
puts "end"
end
@lanej
lanej / frigo.rb
Created August 21, 2009 19:11 — forked from jmettraux/frigo.rb
Prevents circular dependencies, like rails 2.3.3
# a gem freeze module
# (couldn't find one [I liked], so wrote it)
# original is at http://gist.github.com/87639
#
# usage example :
# http://tinyurl.com/ddzvyz
# http://tinyurl.com/cxukck
#--