Skip to content

Commit

Permalink
Add workspace category (#661)
Browse files Browse the repository at this point in the history
* Create a new Workspace command category

* Update readme
  • Loading branch information
st0012 authored Aug 1, 2023
1 parent 9790517 commit 310650c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions lib/irb/cmd/chws.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module IRB
module ExtendCommand

class CurrentWorkingWorkspace < Nop
category "IRB"
category "Workspace"
description "Show the current workspace."

def execute(*obj)
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions lib/irb/cmd/pushws.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module IRB

module ExtendCommand
class Workspaces < Nop
category "IRB"
category "Workspace"
description "Show workspaces."

def execute(*obj)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 310650c

Please sign in to comment.