Skip to content

Instantly share code, notes, and snippets.

@ashaw
Created October 21, 2010 22:44
Show Gist options
  • Save ashaw/639521 to your computer and use it in GitHub Desktop.
Save ashaw/639521 to your computer and use it in GitHub Desktop.
# S_G_WV_0_49607_1.xml
desc "import to db from xml"
task :import do
AP_FILES.each do |file|
a = AP::Import.new(file)
puts file.inspect
file_id = file.gsub(/\/.+\/([A-Z]_[A-Z]_[A-Z]{1,2}_[0-9]{1,2}).*$/){|q| $1.to_s.to_i(36).to_s}
a.to_db(file_id.to_i)
puts "imported #{file}"
end
#store current seat counts in /public/seat_counts.json
Race.save_seat_counts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment