-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
66 lines (53 loc) · 1.38 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
56
57
58
59
60
61
62
63
64
65
66
require 'bundler'
Bundler.require :test
task :default => :spec
desc "Run all tests"
task :spec => ["test:unit", "test:js"]
desc "Run server in development mode"
task :start => 'start:development'
namespace 'test' do
desc "Run the unit tests"
task :unit do
sh 'RACK_ENV=test; bundle exec rspec spec/*_spec.rb --color --format progress'
end
desc "Run the javascript tests"
task :js => 'js:ci'
namespace 'js' do
task :ci => ['jasmine:ci']
desc "Run the javascript tests server"
task :server => ['jasmine:server']
end
end
namespace :start do
[:production, :test, :development].each do |env|
desc "Start server in #{env} mode"
task env do
debug_mode = env == :development ? '--debug' : ''
system("thin -R config.ru #{debug_mode} -e #{env} start")
end
end
end
directory "/tmp/db"
desc "Run the mongo db"
task :db => ["/tmp/db"] do
system("mongod --dbpath /tmp/db")
end
namespace :jasmine do
task :ci => [:require_jasmine] do
Rake::Task['jasmine:ci'].invoke
end
task :server => [:require_jasmine] do
Rake::Task['jasmine:server'].invoke
end
end
task :require_jasmine do
begin
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
system("export DISPLAY=:99.0")
rescue LoadError
task :jasmine do
abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine"
end
end
end