Silence method redefinition warning
This commit is contained in:
parent
f3e4b563d4
commit
b149580632
@ -3,31 +3,33 @@ require 'irb'
|
|||||||
module IRB
|
module IRB
|
||||||
@setup_done = false
|
@setup_done = false
|
||||||
|
|
||||||
def IRB.parse_opts
|
extend Module.new {
|
||||||
end
|
def parse_opts
|
||||||
|
|
||||||
def IRB.start_within(binding)
|
|
||||||
unless @setup_done
|
|
||||||
IRB.setup(nil)
|
|
||||||
@setup_done = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
workspace = WorkSpace.new(binding)
|
def start_within(binding)
|
||||||
irb = Irb.new(workspace)
|
unless @setup_done
|
||||||
|
setup(nil)
|
||||||
@CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
|
@setup_done = true
|
||||||
@CONF[:MAIN_CONTEXT] = irb.context
|
end
|
||||||
|
|
||||||
trap("SIGINT") do
|
workspace = WorkSpace.new(binding)
|
||||||
irb.signal_handle
|
irb = Irb.new(workspace)
|
||||||
end
|
|
||||||
|
@CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
|
||||||
begin
|
@CONF[:MAIN_CONTEXT] = irb.context
|
||||||
catch(:IRB_EXIT) do
|
|
||||||
irb.eval_input
|
trap("SIGINT") do
|
||||||
|
irb.signal_handle
|
||||||
|
end
|
||||||
|
|
||||||
|
begin
|
||||||
|
catch(:IRB_EXIT) do
|
||||||
|
irb.eval_input
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
irb_at_exit
|
||||||
end
|
end
|
||||||
ensure
|
|
||||||
irb_at_exit
|
|
||||||
end
|
end
|
||||||
end
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user