From 7802f01d4fcb9f237cac480364a09f788265fbbd Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Jan 2017 03:11:45 +0000 Subject: [PATCH] prelude.rb: Binding#irb [ci skip] * prelude.rb (Binding#irb): [EXPERIMENTAL] automatically require irb and run. [ruby-core:78960] [Bug #13099] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/irb.rb | 1 + prelude.rb | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib/irb.rb b/lib/irb.rb index 676abe42cd..ca36acd569 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -708,6 +708,7 @@ end class Binding # :nodoc: + undef irb if method_defined?(:irb) def irb IRB.setup(eval("__FILE__")) IRB::Irb.new(IRB::WorkSpace.new(self)).run(IRB.conf) diff --git a/prelude.rb b/prelude.rb index 740aba5b79..231c64e95a 100644 --- a/prelude.rb +++ b/prelude.rb @@ -133,3 +133,10 @@ class IO __write_nonblock(buf, exception) end end + +class Binding + def irb + require 'irb' + irb + end +end