source_file(path)
public
Loads a given file in the current session and displays the source lines
See Irb#suspend_input_method for more information.
Show source
def source_file(path)
irb.suspend_name(path, File.basename(path)) do
irb.suspend_input_method(FileInputMethod.new(path)) do
|back_io|
irb.signal_status(:IN_LOAD) do
if back_io.kind_of?(FileInputMethod)
irb.eval_input
else
begin
irb.eval_input
rescue LoadAbort
print "load abort!!\n"
end
end
end
end
end
end