PATH:
opt
/
alt
/
ruby34
/
share
/
rubygems
/
rubygems
/
commands
# frozen_string_literal: true require_relative "../command" unless defined? Gem::Commands::GenerateIndexCommand class Gem::Commands::GenerateIndexCommand < Gem::Command module RubygemsTrampoline def description # :nodoc: <<~EOF The generate_index command has been moved to the rubygems-generate_index gem. EOF end def execute alert_error "Install the rubygems-generate_index gem for the generate_index command" end def invoke_with_build_args(args, build_args) name = "rubygems-generate_index" spec = begin Gem::Specification.find_by_name(name) rescue Gem::LoadError require "rubygems/dependency_installer" Gem.install(name, Gem::Requirement.default, Gem::DependencyInstaller::DEFAULT_OPTIONS).find {|s| s.name == name } end # remove the methods defined in this file so that the methods defined in the gem are used instead, # and without a method redefinition warning %w[description execute invoke_with_build_args].each do |method| RubygemsTrampoline.remove_method(method) end self.class.singleton_class.remove_method(:new) spec.activate Gem.load_plugin_files spec.matches_for_glob("rubygems_plugin#{Gem.suffix_pattern}") self.class.new.invoke_with_build_args(args, build_args) end end private_constant :RubygemsTrampoline # remove_method(:initialize) warns, but removing new does not warn def self.new command = allocate command.send(:initialize, "generate_index", "Generates the index files for a gem server directory (requires rubygems-generate_index)") command end prepend(RubygemsTrampoline) end end
[-] generate_index_command.rb
[edit]
[-] dependency_command.rb
[edit]
[-] search_command.rb
[edit]
[-] environment_command.rb
[edit]
[-] open_command.rb
[edit]
[-] sources_command.rb
[edit]
[-] owner_command.rb
[edit]
[-] rebuild_command.rb
[edit]
[-] server_command.rb
[edit]
[-] contents_command.rb
[edit]
[-] push_command.rb
[edit]
[-] cleanup_command.rb
[edit]
[-] list_command.rb
[edit]
[-] setup_command.rb
[edit]
[-] signin_command.rb
[edit]
[-] query_command.rb
[edit]
[-] exec_command.rb
[edit]
[-] build_command.rb
[edit]
[-] uninstall_command.rb
[edit]
[-] stale_command.rb
[edit]
[-] fetch_command.rb
[edit]
[+]
..
[-] signout_command.rb
[edit]
[-] info_command.rb
[edit]
[-] unpack_command.rb
[edit]
[-] yank_command.rb
[edit]
[-] rdoc_command.rb
[edit]
[-] install_command.rb
[edit]
[-] update_command.rb
[edit]
[-] mirror_command.rb
[edit]
[-] pristine_command.rb
[edit]
[-] cert_command.rb
[edit]
[-] lock_command.rb
[edit]
[-] help_command.rb
[edit]
[-] check_command.rb
[edit]
[-] outdated_command.rb
[edit]
[-] which_command.rb
[edit]
[-] specification_command.rb
[edit]