From 310650c21322088f9ccf9fb313783dcd1d252967 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 1 Aug 2023 13:51:26 +0100 Subject: [PATCH] Add workspace category (#661) * Create a new Workspace command category * Update readme --- README.md | 6 ++++-- lib/irb/cmd/chws.rb | 4 ++-- lib/irb/cmd/pushws.rb | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c5a19b64b..fb118beb0 100644 --- a/README.md +++ b/README.md @@ -84,14 +84,15 @@ Hello World The following commands are available on IRB. You can get the same output from the `show_cmds` command. - ``` -IRB +Workspace cwws Show the current workspace. chws Change the current workspace to an object. workspaces Show workspaces. pushws Push an object to the workspace stack. popws Pop a workspace from the workspace stack. + +IRB irb_load Load a Ruby file. irb_require Require a Ruby file. source Loads a given file in the current session. @@ -119,6 +120,7 @@ Misc measure `measure` enables the mode to measure processing time. `measure :off` disables it. Context + help [DEPRECATED] Enter the mode to look up RI documents. show_doc Enter the mode to look up RI documents. ls Show methods, constants, and variables. `-g [query]` or `-G [query]` allows you to filter out the output. show_source Show the source code of a given method or constant. diff --git a/lib/irb/cmd/chws.rb b/lib/irb/cmd/chws.rb index 44712fa44..31045f9bb 100644 --- a/lib/irb/cmd/chws.rb +++ b/lib/irb/cmd/chws.rb @@ -13,7 +13,7 @@ module IRB module ExtendCommand class CurrentWorkingWorkspace < Nop - category "IRB" + category "Workspace" description "Show the current workspace." def execute(*obj) @@ -22,7 +22,7 @@ def execute(*obj) end class ChangeWorkspace < Nop - category "IRB" + category "Workspace" description "Change the current workspace to an object." def execute(*obj) diff --git a/lib/irb/cmd/pushws.rb b/lib/irb/cmd/pushws.rb index d64d82218..59996ceb0 100644 --- a/lib/irb/cmd/pushws.rb +++ b/lib/irb/cmd/pushws.rb @@ -12,7 +12,7 @@ module IRB module ExtendCommand class Workspaces < Nop - category "IRB" + category "Workspace" description "Show workspaces." def execute(*obj) @@ -21,7 +21,7 @@ def execute(*obj) end class PushWorkspace < Workspaces - category "IRB" + category "Workspace" description "Push an object to the workspace stack." def execute(*obj) @@ -31,7 +31,7 @@ def execute(*obj) end class PopWorkspace < Workspaces - category "IRB" + category "Workspace" description "Pop a workspace from the workspace stack." def execute(*obj)