Skip to content

Instantly share code, notes, and snippets.

@graemenelson
Created April 10, 2009 14:40
Show Gist options
  • Select an option

  • Save graemenelson/93106 to your computer and use it in GitHub Desktop.

Select an option

Save graemenelson/93106 to your computer and use it in GitHub Desktop.
require 'rake'
require 'rake/rdoctask'
require 'spec/rake/spectask'
require 'sequel'
require File.join( File.dirname(__FILE__), 'lib/database' )
namespace :myapp do
@environment = nil
namespace :db do
desc "run migrations"
task :migrations => :environment do
Database.migrate( @environment )
end
end
task :environment do
@environment = ENV['RACK_ENV'] || :development
end
end
desc "Run rspec"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['specs/*_spec.rb']
end
namespace :spec do
desc "Run rspec with rcov"
Spec::Rake::SpecTask.new('rcov') do |t|
t.spec_files = FileList['specs/*_spec.rb']
t.rcov = true
t.rcov_opts = ['--exclude', 'db,specs,lib/schema.rb']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment