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)
|
begin
|
||||||
class Railtie < ::Rails::Railtie
|
require 'pry'
|
||||||
silence_warnings do
|
|
||||||
begin
|
if (defined?(::Rails::Console) and ::Rails::VERSION::MAJOR >= 3)
|
||||||
require 'pry'
|
class Railtie < ::Rails::Railtie
|
||||||
Rails::Console::IRB = Pry
|
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
|
||||||
rescue LoadError
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
rescue LoadError
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue