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"
|
require "pry-rails/version"
|
||||||
|
|
||||||
module PryRails
|
module PryRails
|
||||||
if(defined?(::Rails) and ::Rails::VERSION::MAJOR >= 3)
|
|
||||||
class Railtie < ::Rails::Railtie
|
|
||||||
silence_warnings do
|
|
||||||
begin
|
begin
|
||||||
require 'pry'
|
require 'pry'
|
||||||
Rails::Console::IRB = 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)
|
unless defined?(Pry::ExtendCommandBundle)
|
||||||
Pry::ExtendCommandBundle = Module.new
|
Pry::ExtendCommandBundle = Module.new
|
||||||
end
|
end
|
||||||
|
|
||||||
if ::Rails::VERSION::MINOR >= 2
|
if ::Rails::VERSION::MINOR >= 2
|
||||||
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
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue