PATH:
opt
/
alt
/
ruby34
/
share
/
gems
/
gems
/
irb-1.14.3
/
lib
/
irb
/
command
# frozen_string_literal: true # # change-ws.rb - # by Keiju ISHITSUKA(keiju@ruby-lang.org) # require_relative "../ext/workspaces" module IRB # :stopdoc: module Command class Workspaces < Base category "Workspace" description "Show workspaces." def execute(_arg) inspection_resuls = irb_context.instance_variable_get(:@workspace_stack).map do |ws| truncated_inspect(ws.main) end puts "[" + inspection_resuls.join(", ") + "]" end private def truncated_inspect(obj) obj_inspection = obj.inspect if obj_inspection.size > 20 obj_inspection = obj_inspection[0, 19] + "...>" end obj_inspection end end class PushWorkspace < Workspaces category "Workspace" description "Push an object to the workspace stack." def execute(arg) if arg.empty? irb_context.push_workspace else obj = eval(arg, irb_context.workspace.binding) irb_context.push_workspace(obj) end super end end class PopWorkspace < Workspaces category "Workspace" description "Pop a workspace from the workspace stack." def execute(_arg) irb_context.pop_workspace super end end end # :startdoc: end
[-] subirb.rb
[edit]
[-] catch.rb
[edit]
[-] continue.rb
[edit]
[-] force_exit.rb
[edit]
[-] chws.rb
[edit]
[-] load.rb
[edit]
[-] break.rb
[edit]
[-] whereami.rb
[edit]
[-] history.rb
[edit]
[-] disable_irb.rb
[edit]
[-] irb_info.rb
[edit]
[-] show_source.rb
[edit]
[-] next.rb
[edit]
[-] delete.rb
[edit]
[-] finish.rb
[edit]
[-] step.rb
[edit]
[-] debug.rb
[edit]
[-] show_doc.rb
[edit]
[-] internal_helpers.rb
[edit]
[-] info.rb
[edit]
[-] pushws.rb
[edit]
[-] help.rb
[edit]
[-] base.rb
[edit]
[-] backtrace.rb
[edit]
[-] ls.rb
[edit]
[-] cd.rb
[edit]
[+]
..
[-] edit.rb
[edit]
[-] measure.rb
[edit]
[-] exit.rb
[edit]
[-] context.rb
[edit]