It's been waaay too long since I last committed. Eesh.

This commit is contained in:
Dan Buch
2012-03-07 00:11:05 -05:00
parent a5b139f6e7
commit ee337ba7ee
15 changed files with 323 additions and 117 deletions

View File

@@ -1,6 +1,13 @@
namespace :maps do
desc 'Index the maps!'
task :index => :environment do
MapCrawler.new(Setting.map(:base_url)).crawl(Map.method(:from_city_name))
desc 'Seed the maps!'
task :seed => :environment do
require 'app/models/map'
csv_filename = File.expand_path(
'../../db/capital-cities.csv', File.dirname(__FILE__)
)
Map.import(csv_filename) do |map|
puts "Seeded map '#{map.name}'"
end
end
end