ruby/lib/irb/cmd/chws.rb
Stan Lo f11ac06337 [ruby/irb] Add workspace category
(https://github.com/ruby/irb/pull/661)

* Create a new Workspace command category

* Update readme

310650c213
2023-08-01 12:51:30 +00:00

36 lines
653 B
Ruby

# frozen_string_literal: false
#
# change-ws.rb -
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
require_relative "nop"
require_relative "../ext/change-ws"
module IRB
# :stopdoc:
module ExtendCommand
class CurrentWorkingWorkspace < Nop
category "Workspace"
description "Show the current workspace."
def execute(*obj)
irb_context.main
end
end
class ChangeWorkspace < Nop
category "Workspace"
description "Change the current workspace to an object."
def execute(*obj)
irb_context.change_workspace(*obj)
irb_context.main
end
end
end
# :startdoc:
end