-
Notifications
You must be signed in to change notification settings - Fork 88
/
Rakefile
44 lines (38 loc) · 1.05 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
require "rubygems"
require "bundler/setup"
require "bundler/gem_tasks"
require "rake/testtask"
require "appraisal"
Rake::TestTask.new do |t|
t.libs.concat %w(pry-rails spec)
t.pattern = "spec/*_spec.rb"
end
desc 'Start the Rails server'
task :server => :development_env do
require 'rails/commands/server'
Rails::Server.start(
:server => 'WEBrick',
:environment => 'development',
:Host => '0.0.0.0',
:Port => 3000,
:config => 'config/config.ru'
)
end
desc 'Start the Rails console'
task :console => :development_env do
if (Rails::VERSION::MAJOR == 5 && Rails::VERSION::MINOR >= 1) ||
Rails::VERSION::MAJOR >= 6
require 'rails/command'
require 'rails/commands/console/console_command'
else
require 'rails/commands/console'
end
Rails::Console.start(Rails.application)
end
task :development_env do
ENV['RAILS_ENV'] = 'development'
require File.expand_path('../spec/config/environment', __FILE__)
Dir.chdir(Rails.application.root)
end
# Must invoke indirectly, using `rake appraisal`.
task :default => [:test]