Activate irb if irb is bundled gems
This commit is contained in:
parent
76d927f88f
commit
bb7025b7e8
@ -1,8 +1,12 @@
|
|||||||
class Binding
|
class Binding
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
def irb
|
def irb
|
||||||
force_activate 'irb'
|
begin
|
||||||
require 'irb'
|
require 'irb'
|
||||||
|
rescue LoadError, Gem::LoadError
|
||||||
|
force_activate 'irb'
|
||||||
|
retry
|
||||||
|
end
|
||||||
irb
|
irb
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -10,8 +14,6 @@ class Binding
|
|||||||
alias irb irb # :nodoc:
|
alias irb irb # :nodoc:
|
||||||
|
|
||||||
private def force_activate(gem)
|
private def force_activate(gem)
|
||||||
return if !defined?(Bundler) || Gem.loaded_specs.key?(gem)
|
|
||||||
|
|
||||||
Bundler.reset!
|
Bundler.reset!
|
||||||
|
|
||||||
builder = Bundler::Dsl.new
|
builder = Bundler::Dsl.new
|
||||||
|
Loading…
x
Reference in New Issue
Block a user