-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
53 lines (41 loc) · 1.01 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 "rake/testtask"
task :default => :test
# The command which runs the app.
RUN_COMMAND = "bin/rackup"
desc "Load the application environment for tasks that require it."
task :environment do
require "./app"
end
desc "Set the test environment for Rack."
task :test_env do
ENV["RACK_ENV"] = "test"
end
task :test => :test_env
Rake::TestTask.new do |t|
t.test_files = FileList["tests/**/*.rb"]
end
desc "Regenerate application documentation"
task :docs do
system "bin/rocco app.rb models/*.rb -o docs"
end
desc "Run the application."
task :run do
system RUN_COMMAND
end
desc "Run the application under rerun, which will monitor changes and restart."
task :rerun do
system "bin/rerun -p'./**/*.{rb,ru}' #{RUN_COMMAND}"
end
namespace :rerun do
desc "Rerun tests rather than the main app."
task :test do
system "bin/rerun bin/rake test"
end
end
desc "Open a pry console within the app context."
task :pry => :environment do
puts "Not yet available"
exit 1
require "pry"
binding.pry
end