forked from globalize/globalize
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
55 lines (44 loc) · 1.16 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require 'rake'
require 'rake/testtask'
require 'rdoc/task'
desc 'Default: run unit tests.'
task :default => :test
desc 'Run all tests.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Globalize'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end
task :load_path do
%w(lib test).each do |path|
$LOAD_PATH.unshift(File.expand_path("../#{path}", __FILE__))
end
end
namespace :db do
desc 'Create the database'
task :create => :load_path do
require 'support/database'
Globalize::Test::Database.create!
end
desc "Drop the database"
task :drop => :load_path do
require 'support/database'
Globalize::Test::Database.drop!
end
desc "Set up the database schema"
task :migrate => :load_path do
require 'support/database'
Globalize::Test::Database.migrate!
# ActiveRecord::Schema.migrate :up
end
desc "Drop and recreate the database schema"
task :reset => [:drop, :create]
end