mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Activate irb if irb is bundled gems
This commit is contained in:
parent
76d927f88f
commit
bb7025b7e8
1 changed files with 6 additions and 4 deletions
10
prelude.rb
10
prelude.rb
|
@ -1,8 +1,12 @@
|
|||
class Binding
|
||||
# :nodoc:
|
||||
def irb
|
||||
force_activate 'irb'
|
||||
require 'irb'
|
||||
begin
|
||||
require 'irb'
|
||||
rescue LoadError, Gem::LoadError
|
||||
force_activate 'irb'
|
||||
retry
|
||||
end
|
||||
irb
|
||||
end
|
||||
|
||||
|
@ -10,8 +14,6 @@ class Binding
|
|||
alias irb irb # :nodoc:
|
||||
|
||||
private def force_activate(gem)
|
||||
return if !defined?(Bundler) || Gem.loaded_specs.key?(gem)
|
||||
|
||||
Bundler.reset!
|
||||
|
||||
builder = Bundler::Dsl.new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue