1
0
Fork 0
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:
Norimasa Ando 2015-02-07 17:38:46 +09:00
parent 520e39385d
commit fe29ddcddf
4 changed files with 20 additions and 5 deletions

View file

@ -32,3 +32,9 @@ appraise "rails42" do
gem "mongoid" gem "mongoid"
gem "sqlite3" gem "sqlite3"
end end
appraise "rails50" do
gem "rails", github: "rails/rails"
gem 'arel', github: "rails/arel"
gem "sqlite3"
end

9
gemfiles/rails50.gemfile Normal file
View 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 => "../"

View file

@ -16,8 +16,8 @@ class PryRails::ShowRoutes < Pry::ClassCommand
all_routes = Rails.application.routes.routes all_routes = Rails.application.routes.routes
formatted = case Rails.version.to_s formatted = case Rails.version.to_s
when /^4/ when /^[45]/
process_rails_4(all_routes) process_rails_4_and_5(all_routes)
when /^3\.2/ when /^3\.2/
process_rails_3_2(all_routes) process_rails_3_2(all_routes)
else else
@ -54,7 +54,7 @@ class PryRails::ShowRoutes < Pry::ClassCommand
Rails::Application::RouteInspector.new.format(all_routes) Rails::Application::RouteInspector.new.format(all_routes)
end end
def process_rails_4(all_routes) def process_rails_4_and_5(all_routes)
require 'action_dispatch/routing/inspector' require 'action_dispatch/routing/inspector'
ActionDispatch::Routing::RoutesInspector.new(all_routes).format(ActionDispatch::Routing::ConsoleFormatter.new).split(/\n/) ActionDispatch::Routing::RoutesInspector.new(all_routes).format(ActionDispatch::Routing::ConsoleFormatter.new).split(/\n/)
end end

View file

@ -14,12 +14,12 @@ module PryRails
end end
end end
if Rails::VERSION::MAJOR == 4 if Rails::VERSION::MAJOR == 4 || Rails::VERSION::MAJOR == 5
Rails.application.config.console = Pry Rails.application.config.console = Pry
end end
if (Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 2) || 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/app"
require "rails/console/helpers" require "rails/console/helpers"
TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods