require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Default: run unit tests.' task :default => :test desc 'Test the Wiki Engine.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.pattern = 'test/**/*_test.rb' t.verbose = true end desc 'Generate documentation for the Wiki Engine.' Rake::RDocTask.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' rdoc.title = 'Login Engine' rdoc.options << '--line-numbers --inline-source' rdoc.rdoc_files.include('README') rdoc.rdoc_files.include('lib/**/*.rb') rdoc.rdoc_files.include('app/helpers/*.rb') rdoc.rdoc_files.include('app/controllers/*.rb') end desc 'Import the Wiki Engine schema.' task :db_schema_import => :environment do load 'db/schema.rb' end desc "Migrate the database according to the migrate scripts in db/migrate (only supported on PG/MySQL). A specific version can be targetted with VERSION=x" task :migrate => :environment do ActiveRecord::Migrator.migrate("db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil) # not sure how this will interact.... Rake::Task[:db_schema_dump].invoke if ActiveRecord::Base.schema_format == :ruby end task :environment do require('../../../config/environment') end