Skip to content
On this page

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class · Ruby 3.1

Gem::Command

< Object include Gem::UserInteraction 30 instance methods 10 class methods

Base class for all Gem commands. When creating a new gem command, define initialize, execute, arguments, defaults_str, description and usage (as appropriate). See the above mentioned methods for details.

A very good example to look at is Gem::Commands::ContentsCommand

Class methods 10

Instance methods 30

Attributes
Read

The name of the command.

Read & Write

The default options for the command.

Read

The options for the command.

Read & Write

The name of the command for command-line invocation.

Read & Write

A short description of the command.