suspend_name(path = nil, name = nil)
public
Evaluates the given block using the given path as the
Context#irb_path and name as the Context#irb_name.
Used by the irb command source, see IRB@IRB+Sessions for more information.
Show source
def suspend_name(path = nil, name = nil)
@context.irb_path, back_path = path, @context.irb_path if path
@context.irb_name, back_name = name, @context.irb_name if name
begin
yield back_path, back_name
ensure
@context.irb_path = back_path if path
@context.irb_name = back_name if name
end
end