1
0
Fork 0
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:
Robin Wenglewski 2012-02-08 17:13:54 -08:00
commit 36993386aa

View file

@ -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