diff options
Diffstat (limited to 'prelude.rb')
| -rw-r--r-- | prelude.rb | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/prelude.rb b/prelude.rb index b1e477a3ea..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,13 +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 + +module Enumerable + # Makes a set from the enumerable object with given arguments. + def to_set(&block) + Set.new(self, &block) + end end |
