-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
24 lines (20 loc) · 704 Bytes
/
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
require_relative "./config/environment"
require "sinatra/activerecord/rake"
desc "Start the server"
task :server do
if ActiveRecord::Base.connection.migration_context.needs_migration?
puts "Migrations are pending. Make sure to run `rake db:migrate` first."
return
end
# rackup -p PORT will run on the port specified (9292 by default)
ENV["PORT"] ||= "9292"
rackup = "rackup -p #{ENV['PORT']}"
# rerun allows auto-reloading of server when files are updated
# -b runs in the background (include it or binding.pry won't work)
exec "bundle exec rerun -b '#{rackup}'"
end
desc "Start the console"
task :console do
ActiveRecord::Base.logger = Logger.new(STDOUT)
Pry.start
end