Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (40 sloc) 1.08 KB
require 'spec/rake/spectask'
task :default => :test
task :test => :spec
if !defined?(Spec)
puts "spec targets require RSpec"
else
desc "Run all examples"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/**/*.rb']
t.spec_opts = ['-cfs']
end
end
namespace :db do
desc 'Auto-migrate the database (destroys data)'
task :migrate => :environment do
DataMapper.auto_migrate!
end
desc 'Auto-upgrade the database (preserves data)'
task :upgrade => :environment do
DataMapper.auto_upgrade!
end
end
namespace :twitter do
desc 'Update the local status cache'
task :update => :environment do
count = Status.update
puts "#{count} new status updates retrieved"
end
end
namespace :gems do
desc 'Install required gems'
task :install do
required_gems = %w{ sinatra haml rspec rack-test dm-core dm-validations
dm-aggregates hayesdavis-grackle rspec_hpricot_matchers }
required_gems.each { |required_gem| system "sudo gem install #{required_gem}" }
end
end
task :environment do
require 'environment'
end