Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Gem::Commands::ContentsCommand.new
new
lib/rubygems/commands/contents_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/lib/rubygems/commands/contents_command.rb, line 9
def initialize
super "contents", "Display the contents of the installed gems",
specdirs: [], lib_only: false, prefix: true,
show_install_dir: false
add_version_option
add_option("--all",
"Contents for all gems") do |all, options|
options[:all] = all
end
add_option("-s", "--spec-dir a,b,c", Array,
"Search for gems under specific paths") do |spec_dirs, options|
options[:specdirs] = spec_dirs
end
add_option("-l", "--[no-]lib-only",
"Only return files in the Gem's lib_dirs") do |lib_only, options|
options[:lib_only] = lib_only
end
add_option("--[no-]prefix",
"Don't include installed path prefix") do |prefix, options|
options[:prefix] = prefix
end
add_option("--[no-]show-install-dir",
"Show only the gem install dir") do |show, options|
options[:show_install_dir] = show
end
@path_kind = nil
@spec_dirs = nil
@version = nil
end
No documentation available