Skip to content

Instantly share code, notes, and snippets.

@wr0ngway
Created November 20, 2009 16:13
Show Gist options
  • Save wr0ngway/239589 to your computer and use it in GitHub Desktop.
Save wr0ngway/239589 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Simple lighthouse export
require 'lib/lighthouse'
include Lighthouse
Lighthouse.account = "sml"
#### You can use `authenticate` OR `token`
Lighthouse.authenticate('', '')
#Lighthouse.token = 'YOUR_TOKEN'
projects = Project.find(:all)
open("projects.xml", 'w') do |f|
f.write(projects.to_xml)
end
projects.each do |p|
open("tickets-#{p.name}.xml", 'w') do |f|
f.write(p.tickets.to_xml)
end
open("messages-#{p.name}.xml", 'w') do |f|
f.write(p.messages.to_xml)
end
open("milestones-#{p.name}.xml", 'w') do |f|
f.write(p.milestones.to_xml)
end
open("changesets-#{p.name}.yml", 'w') do |f|
f.write(YAML.dump(p.changesets))
end
open("bins-#{p.name}.xml", 'w') do |f|
f.write(p.bins.to_xml)
end
open("memberships-#{p.name}.xml", 'w') do |f|
f.write(p.memberships.to_xml)
end
open("tags-#{p.name}.xml", 'w') do |f|
f.write(p.tags.to_xml)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment