mirror of
https://github.com/pry/pry-rails.git
synced 2022-11-09 12:36:03 -05:00
Merge pull request #14 from rwfitzge/master
Fix major bug in my last pull
This commit is contained in:
commit
36993386aa
1 changed files with 11 additions and 8 deletions
|
@ -1,23 +1,26 @@
|
|||
require "pry-rails/version"
|
||||
|
||||
module PryRails
|
||||
if(defined?(::Rails) and ::Rails::VERSION::MAJOR >= 3)
|
||||
class Railtie < ::Rails::Railtie
|
||||
silence_warnings do
|
||||
begin
|
||||
require 'pry'
|
||||
Rails::Console::IRB = Pry
|
||||
begin
|
||||
require 'pry'
|
||||
|
||||
if (defined?(::Rails::Console) and ::Rails::VERSION::MAJOR >= 3)
|
||||
class Railtie < ::Rails::Railtie
|
||||
silence_warnings do
|
||||
::Rails::Console::IRB = Pry
|
||||
|
||||
unless defined?(Pry::ExtendCommandBundle)
|
||||
Pry::ExtendCommandBundle = Module.new
|
||||
end
|
||||
|
||||
if ::Rails::VERSION::MINOR >= 2
|
||||
require "rails/console/app"
|
||||
require "rails/console/helpers"
|
||||
TOPLEVEL_BINDING.eval('self').extend Rails::ConsoleMethods
|
||||
TOPLEVEL_BINDING.eval('self').extend ::Rails::ConsoleMethods
|
||||
end
|
||||
rescue LoadError
|
||||
end
|
||||
end
|
||||
end
|
||||
rescue LoadError
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue