Initializes a generic gem command named command
. summary
is a short description displayed in ‘gem help commands`. defaults
are the default options. Defaults should be mirrored in defaults_str
, unless there are none.
When defining a new command subclass, use add_option
to add command-line switches.
Unhandled arguments (gem names, files, etc.) are left in options[:args]
.
Register all the subcommands supported by the gem command.
Create the config file object. args
is the list of arguments from the command line.
The following command line options are handled early here rather than later at the time most command options are processed.
--config-file
, --config-file==NAME
Obviously these need to be handled by the ConfigFile
object to ensure we get the right config file.
--backtrace
Backtrace needs to be turned on early so that errors before normal option parsing can be properly handled.
--debug
Enable Ruby level debug messages. Handled early for the same reason as –backtrace.
Constructs a dependency with name
and requirements
. The last argument can optionally be the dependency type, which defaults to :runtime
.
Creates a new installer instance.
Options are:
Alternate repository path to store .gem files in.
:local, :remote, or :both. :local only searches gems in the current directory. :remote searches only gems in Gem::sources
. :both searches both.
See Gem::Installer::new
.
See Gem::Installer#initialize.
Don’t install any dependencies.
Allow prerelease versions. See install
.
See Gem::Installer::new
and Gem::Security
.
Creates a new DependencyList
. If development
is true, development dependencies will be included.
Creates a new Gem::Doctor
that will clean up gem_repository
. Only one gem repository may be cleaned at a time.
If dry_run
is true no files or directories will be removed.