mirror of
https://github.com/pry/pry-rails.git
synced 2022-11-09 12:36:03 -05:00
Update Appraisals, add rails 5.0.0.alpha support
This commit is contained in:
parent
520e39385d
commit
fe29ddcddf
4 changed files with 20 additions and 5 deletions
|
@ -32,3 +32,9 @@ appraise "rails42" do
|
|||
gem "mongoid"
|
||||
gem "sqlite3"
|
||||
end
|
||||
|
||||
appraise "rails50" do
|
||||
gem "rails", github: "rails/rails"
|
||||
gem 'arel', github: "rails/arel"
|
||||
gem "sqlite3"
|
||||
end
|
||||
|
|
9
gemfiles/rails50.gemfile
Normal file
9
gemfiles/rails50.gemfile
Normal file
|
@ -0,0 +1,9 @@
|
|||
# This file was generated by Appraisal
|
||||
|
||||
source "http://rubygems.org"
|
||||
|
||||
gem "rails", :github => "rails/rails"
|
||||
gem "arel", :github => "rails/arel"
|
||||
gem "sqlite3"
|
||||
|
||||
gemspec :path => "../"
|
|
@ -16,8 +16,8 @@ class PryRails::ShowRoutes < Pry::ClassCommand
|
|||
all_routes = Rails.application.routes.routes
|
||||
|
||||
formatted = case Rails.version.to_s
|
||||
when /^4/
|
||||
process_rails_4(all_routes)
|
||||
when /^[45]/
|
||||
process_rails_4_and_5(all_routes)
|
||||
when /^3\.2/
|
||||
process_rails_3_2(all_routes)
|
||||
else
|
||||
|
@ -54,7 +54,7 @@ class PryRails::ShowRoutes < Pry::ClassCommand
|
|||
Rails::Application::RouteInspector.new.format(all_routes)
|
||||
end
|
||||
|
||||
def process_rails_4(all_routes)
|
||||
def process_rails_4_and_5(all_routes)
|
||||
require 'action_dispatch/routing/inspector'
|
||||
ActionDispatch::Routing::RoutesInspector.new(all_routes).format(ActionDispatch::Routing::ConsoleFormatter.new).split(/\n/)
|
||||
end
|
||||
|
|
|
@ -14,12 +14,12 @@ module PryRails
|
|||
end
|
||||
end
|
||||
|
||||
if Rails::VERSION::MAJOR == 4
|
||||
if Rails::VERSION::MAJOR == 4 || Rails::VERSION::MAJOR == 5
|
||||
Rails.application.config.console = Pry
|
||||
end
|
||||
|
||||
if (Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 2) ||
|
||||
Rails::VERSION::MAJOR == 4
|
||||
Rails::VERSION::MAJOR == 4 || Rails::VERSION::MAJOR == 5
|
||||
require "rails/console/app"
|
||||
require "rails/console/helpers"
|
||||
TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods
|
||||
|
|
Loading…
Reference in a new issue