-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
31 lines (25 loc) · 872 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'spec/rake/spectask'
require 'active_record'
require 'yaml'
#task :default => :migrate
desc "Migrate the database through scripts in db/migrate. Target specific version with VERSION=x"
task :migrate => :environment do
ActiveRecord::Migrator.migrate('db/migrations', ENV["VERSION"] ? ENV["VERSION"].to_i : nil )
end
task :environment do
sh "mkdir -p log; touch log/database.log"
ActiveRecord::Base.establish_connection(YAML::load(File.open('config/database.yml')))
ActiveRecord::Base.logger = Logger.new(File.open('log/database.log', 'a'))
end
desc 'Default: run specs.'
task :default => :spec
desc 'Test the linode library.'
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
end
desc 'Test the linode library.'
task :test => :spec