mirror of
https://github.com/pry/pry-rails.git
synced 2022-11-09 12:36:03 -05:00

In addition to adding scenarios for 5.2 and 6.0, I had to do some cleanup to get everything working well: * Replace string-based version checks with numeric ones, and update all version checks to treat 6+ the same as 5 (except where necessary). * Avoid touching `ActiveSupport::Deprecation::DeprecationProxy` instances to fix a couple of warnings in Rails 6. * Update Bundler as part of container setup, because Rails 6's config seems to rely on a newer version of Bundler than the one that comes with the Ruby image. * Update the regexes in the `show-routes` spec to be compatible with 5.2 and up. * Add a new code path to `show-routes` for Rails 6. * Upgrade all bundles, just for hygiene.
44 lines
1 KiB
Ruby
44 lines
1 KiB
Ruby
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]
|