diff options
Diffstat (limited to 'prelude.rb')
| -rw-r--r-- | prelude.rb | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/prelude.rb b/prelude.rb index 8fd6e6cb77..b6c610dd58 100644 --- a/prelude.rb +++ b/prelude.rb @@ -1,8 +1,18 @@ class Binding # :nodoc: - def irb - require 'irb' - irb + def irb(...) + suppress = Thread.current[:__bundled_gems_warning_suppression] + Thread.current[:__bundled_gems_warning_suppression] = ['reline', 'rdoc'] + + begin + require 'irb' + rescue LoadError, Gem::LoadError + Gem::BUNDLED_GEMS.force_activate 'irb' + require 'irb' + end + irb(...) + ensure + Thread.current[:__bundled_gems_warning_suppression] = suppress end # suppress redefinition warning @@ -10,22 +20,22 @@ class Binding end module Kernel + # :stopdoc: def pp(*objs) require 'pp' pp(*objs) end # suppress redefinition warning - alias pp pp # :nodoc: + alias pp pp private :pp + # :startdoc: end -autoload :Set, 'set' - module Enumerable # Makes a set from the enumerable object with given arguments. - def to_set(klass = Set, *args, &block) - klass.new(self, *args, &block) + def to_set(&block) + Set.new(self, &block) end end |
