On this page
Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class · Ruby 3.4
Gem::Command
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
#add_extra_args
#add_option
#add_parser_run_info
#arguments
#begins?
#check_deprecated_options
#configure_options
#create_option_parser
#defaults_str
#deprecated?
#deprecate_option
#description
#execute
#get_all_gem_names
#get_all_gem_names_and_versions
#get_one_gem_name
#get_one_optional_argument
#handle_options
#handles?
#invoke
#invoke_with_build_args
#merge_options
#option_is_deprecated?
#parser
#remove_option
#show_help
#show_lookup_failure
#usage
#when_invoked
#wrap
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.