ruby-changes:45201
From: nobu <ko1@a...>
Date: Fri, 6 Jan 2017 12:11:49 +0900 (JST)
Subject: [ruby-changes:45201] nobu:r57274 (trunk): prelude.rb: Binding#irb [ci skip]
nobu 2017-01-06 12:11:45 +0900 (Fri, 06 Jan 2017) New Revision: 57274 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57274 Log: prelude.rb: Binding#irb [ci skip] * prelude.rb (Binding#irb): [EXPERIMENTAL] automatically require irb and run. [ruby-core:78960] [Bug #13099] Modified files: trunk/lib/irb.rb trunk/prelude.rb Index: prelude.rb =================================================================== --- prelude.rb (revision 57273) +++ prelude.rb (revision 57274) @@ -133,3 +133,10 @@ class IO https://github.com/ruby/ruby/blob/trunk/prelude.rb#L133 __write_nonblock(buf, exception) end end + +class Binding + def irb + require 'irb' + irb + end +end Index: lib/irb.rb =================================================================== --- lib/irb.rb (revision 57273) +++ lib/irb.rb (revision 57274) @@ -708,6 +708,7 @@ end https://github.com/ruby/ruby/blob/trunk/lib/irb.rb#L708 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/