summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-06 03:11:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-06 03:11:45 +0000
commit7802f01d4fcb9f237cac480364a09f788265fbbd (patch)
treecf8e72e076f11ca513e3d73ce21f468ab30c3cf2
parent93824a5f7390b5a548e9e1ce313ca279db8dc99b (diff)
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
-rw-r--r--lib/irb.rb1
-rw-r--r--prelude.rb7
2 files changed, 8 insertions, 0 deletions
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