End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Commands::SetupCommand.new
new
lib/rubygems/commands/setup_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/rubygems/commands/setup_command.rb, line 14
def initialize
super "setup", "Install RubyGems",
:format_executable => false, :document => %w[ri],
:force => true,
:site_or_vendor => "sitelibdir",
:destdir => "", :prefix => "", :previous_version => "",
:regenerate_binstubs => true,
:regenerate_plugins => true
add_option "--previous-version=VERSION",
"Previous version of RubyGems",
"Used for changelog processing" do |version, options|
options[:previous_version] = version
end
add_option "--prefix=PREFIX",
"Prefix path for installing RubyGems",
"Will not affect gem repository location" do |prefix, options|
options[:prefix] = File.expand_path prefix
end
add_option "--destdir=DESTDIR",
"Root directory to install RubyGems into",
"Mainly used for packaging RubyGems" do |destdir, options|
options[:destdir] = File.expand_path destdir
end
add_option "--[no-]vendor",
"Install into vendorlibdir not sitelibdir" do |vendor, options|
options[:site_or_vendor] = vendor ? "vendorlibdir" : "sitelibdir"
end
add_option "--[no-]format-executable",
"Makes `gem` match ruby",
"If Ruby is ruby18, gem will be gem18" do |value, options|
options[:format_executable] = value
end
add_option "--[no-]document [TYPES]", Array,
"Generate documentation for RubyGems",
"List the documentation types you wish to",
"generate. For example: rdoc,ri" do |value, options|
options[:document] = case value
when nil then %w[rdoc ri]
when false then []
else value
end
end
add_option "--[no-]rdoc",
"Generate RDoc documentation for RubyGems" do |value, options|
if value
options[:document] << "rdoc"
else
options[:document].delete "rdoc"
end
options[:document].uniq!
end
add_option "--[no-]ri",
"Generate RI documentation for RubyGems" do |value, options|
if value
options[:document] << "ri"
else
options[:document].delete "ri"
end
options[:document].uniq!
end
add_option "--[no-]regenerate-binstubs",
"Regenerate gem binstubs" do |value, options|
options[:regenerate_binstubs] = value
end
add_option "--[no-]regenerate-plugins",
"Regenerate gem plugins" do |value, options|
options[:regenerate_plugins] = value
end
add_option "-f", "--[no-]force",
"Forcefully overwrite binstubs" do |value, options|
options[:force] = value
end
add_option("-E", "--[no-]env-shebang",
"Rewrite executables with a shebang",
"of /usr/bin/env") do |value, options|
options[:env_shebang] = value
end
@verbose = nil
end
No documentation available