-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
48 lines (40 loc) · 1.07 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
require 'yaml'
namespace :test do
desc "Tests."
task :test do
mt = `mongo --version`
if (mt.include? "Command not found")
abort 'MongoDB does not appear to be installed. Please install MongoDB before running the script.'
end
end
end
namespace :bundle do
desc "Runs bundler."
task :start do
environment = 'development'
config_file = File.dirname(__FILE__) + '/config/config.yml'
config = YAML.load_file(config_file)
mtime = File.mtime(File.dirname(__FILE__) + '/Gemfile').to_i
if (mtime > config[environment]['last_bundle'])
system "bundle install"
config[environment]['last_bundle'] = Time.now.to_i
File.open(config_file, 'w') do |f|
YAML.dump(config, f)
end
end
end
end
namespace :mongodb do
desc "Start MongoDB for development."
task :start do
system "mongod"
end
end
namespace :haystack do
desc "Start Haystack for development."
task :start do
system "shotgun config.ru"
end
end
desc "Start everything."
task :start => ['test:test','bundle:start','mongodb:start','haystack:start']