Skip to content

Commit bb7025b

Browse files
committed
Activate irb if irb is bundled gems
1 parent 76d927f commit bb7025b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

prelude.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
class Binding
22
# :nodoc:
33
def irb
4-
force_activate 'irb'
5-
require 'irb'
4+
begin
5+
require 'irb'
6+
rescue LoadError, Gem::LoadError
7+
force_activate 'irb'
8+
retry
9+
end
610
irb
711
end
812

913
# suppress redefinition warning
1014
alias irb irb # :nodoc:
1115

1216
private def force_activate(gem)
13-
return if !defined?(Bundler) || Gem.loaded_specs.key?(gem)
14-
1517
Bundler.reset!
1618

1719
builder = Bundler::Dsl.new

0 commit comments

Comments
 (0)