forked from Threespot/tolaria
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
53 lines (43 loc) · 1.24 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
require "bundler/setup"
TOLARIA_ROOT = File.dirname(__FILE__)
Bundler::GemHelper.install_tasks
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "lib"
t.libs << "test"
t.pattern = "test/**/*_test.rb"
t.verbose = false
t.warning = false
end
task default: :test
desc "Create an admin in the demo development database"
namespace :admin do
task :create do
Dir.chdir "#{TOLARIA_ROOT}/test/demo"
system "./bin/rake db:migrate"
exec "./bin/rake admin:create"
end
end
desc "Migrate the development database"
namespace :db do
task :migrate do
Dir.chdir "#{TOLARIA_ROOT}/test/demo"
system "./bin/rake db:migrate"
end
end
desc "Start a Rails Webrick server with Tolaria and some example models loaded"
task :server do
port = ENV.fetch("PORT", 8080)
binding = ENV.fetch("BIND_ON", "0.0.0.0")
Dir.chdir "#{TOLARIA_ROOT}/test/demo"
system "./bin/rake db:migrate"
exec "./bin/rails server --environment development --port #{port}"
end
desc "Start a Rails console with Tolaria loaded"
task :console do
Dir.chdir "#{TOLARIA_ROOT}/test/demo"
system "./bin/rake db:migrate"
exec "./bin/rails console"
end
desc "Start a Rails console with Tolaria loaded (same as `rake console`)"
task :shell => :console