raking for better dropping and loading

This commit is contained in:
Dan Buch 2012-02-29 09:21:06 -05:00
parent 04182f3b80
commit 8bf785f48a
3 changed files with 24 additions and 0 deletions

View File

@ -2,5 +2,6 @@ source :rubygems
gem 'fastercsv'
gem 'hiredis'
gem 'rake'
gem 'redis'
gem 'slop'

View File

@ -3,6 +3,7 @@ GEM
specs:
fastercsv (1.5.4)
hiredis (0.4.4)
rake (0.9.2.2)
redis (2.2.2)
slop (3.0.4)
@ -12,5 +13,6 @@ PLATFORMS
DEPENDENCIES
fastercsv
hiredis
rake
redis
slop

21
redis-with-ruby/Rakefile Normal file
View File

@ -0,0 +1,21 @@
desc 'drop all of the earthquake data'
task :drop do
get_earthquakes.drop_all
end
desc 'load all of the earthquake data'
task :load do
get_earthquakes.load_data
end
desc 'drop, then load all of the earthquake data'
task :reload => [:drop, :load]
task :default => :load
def get_earthquakes
require File.expand_path('../earthquakes', __FILE__)
Earthquakes.new
end