From 390acc75c1c2002c6c1af639ca61297948989b07 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 1 Aug 2023 13:08:05 +0100 Subject: [PATCH 1/2] Create a new Workspace command category --- lib/irb/cmd/chws.rb | 4 ++-- lib/irb/cmd/pushws.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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) From 89edf11e0fd23fe53f986874f343b6903409c1c3 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 1 Aug 2023 13:09:11 +0100 Subject: [PATCH 2/2] Update readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 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.