diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 9e8776b027..80708e2aa0 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -12,11 +12,11 @@ module Gem end # Must be first since it unloads the prelude from 1.9.2 -require 'rubygems/compatibility' +require_relative 'rubygems/compatibility' -require 'rubygems/defaults' -require 'rubygems/deprecate' -require 'rubygems/errors' +require_relative 'rubygems/defaults' +require_relative 'rubygems/deprecate' +require_relative 'rubygems/errors' ## # RubyGems is the Ruby standard for publishing and managing third party @@ -559,7 +559,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} # => [#] def self.install(name, version = Gem::Requirement.default, *options) - require "rubygems/dependency_installer" + require_relative "rubygems/dependency_installer" inst = Gem::DependencyInstaller.new(*options) inst.install name, version inst.installed_gems @@ -625,12 +625,12 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} rescue ::LoadError # If we can't load psych, that's fine, go on. else - require 'rubygems/psych_additions' - require 'rubygems/psych_tree' + require_relative 'rubygems/psych_additions' + require_relative 'rubygems/psych_tree' end require 'yaml' - require 'rubygems/safe_yaml' + require_relative 'rubygems/safe_yaml' @yaml_loaded = true end @@ -990,7 +990,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} # Lazily loads DefaultUserInteraction and returns the default UI. def self.ui - require 'rubygems/user_interaction' + require_relative 'rubygems/user_interaction' Gem::DefaultUserInteraction.ui end @@ -1110,7 +1110,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} end ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path) - require 'rubygems/user_interaction' + require_relative 'rubygems/user_interaction' require "bundler" begin Gem::DefaultUserInteraction.use_ui(ui) do @@ -1322,7 +1322,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} autoload :Version, File.expand_path('rubygems/version', __dir__) end -require 'rubygems/exceptions' +require_relative 'rubygems/exceptions' # REFACTOR: This should be pulled out into some kind of hacks file. begin @@ -1353,6 +1353,6 @@ end # Loads the default specs. Gem::Specification.load_defaults -require 'rubygems/core_ext/kernel_gem' -require 'rubygems/core_ext/kernel_require' -require 'rubygems/core_ext/kernel_warn' +require_relative 'rubygems/core_ext/kernel_gem' +require_relative 'rubygems/core_ext/kernel_require' +require_relative 'rubygems/core_ext/kernel_warn' diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb index 2409550882..39bf8bd30d 100644 --- a/lib/rubygems/command_manager.rb +++ b/lib/rubygems/command_manager.rb @@ -5,9 +5,9 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems/command' -require 'rubygems/user_interaction' -require 'rubygems/text' +require_relative 'command' +require_relative 'user_interaction' +require_relative 'text' ## # The command manager registers and installs all the individual sub-commands diff --git a/lib/rubygems/commands/build_command.rb b/lib/rubygems/commands/build_command.rb index 842ec1855a..6d1a057dfa 100644 --- a/lib/rubygems/commands/build_command.rb +++ b/lib/rubygems/commands/build_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/package' -require 'rubygems/version_option' +require_relative '../command' +require_relative '../package' +require_relative '../version_option' class Gem::Commands::BuildCommand < Gem::Command include Gem::VersionOption diff --git a/lib/rubygems/commands/cert_command.rb b/lib/rubygems/commands/cert_command.rb index 3fc0daea7d..bdfeb0ba6e 100644 --- a/lib/rubygems/commands/cert_command.rb +++ b/lib/rubygems/commands/cert_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/security' +require_relative '../command' +require_relative '../security' class Gem::Commands::CertCommand < Gem::Command def initialize diff --git a/lib/rubygems/commands/check_command.rb b/lib/rubygems/commands/check_command.rb index 8b8eda53cf..3b6b97ae3b 100644 --- a/lib/rubygems/commands/check_command.rb +++ b/lib/rubygems/commands/check_command.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/version_option' -require 'rubygems/validator' -require 'rubygems/doctor' +require_relative '../command' +require_relative '../version_option' +require_relative '../validator' +require_relative '../doctor' class Gem::Commands::CheckCommand < Gem::Command include Gem::VersionOption diff --git a/lib/rubygems/commands/cleanup_command.rb b/lib/rubygems/commands/cleanup_command.rb index 662badce33..c965085880 100644 --- a/lib/rubygems/commands/cleanup_command.rb +++ b/lib/rubygems/commands/cleanup_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/dependency_list' -require 'rubygems/uninstaller' +require_relative '../command' +require_relative '../dependency_list' +require_relative '../uninstaller' class Gem::Commands::CleanupCommand < Gem::Command def initialize diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb index f17aed64db..716022c458 100644 --- a/lib/rubygems/commands/contents_command.rb +++ b/lib/rubygems/commands/contents_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/version_option' +require_relative '../command' +require_relative '../version_option' class Gem::Commands::ContentsCommand < Gem::Command include Gem::VersionOption diff --git a/lib/rubygems/commands/dependency_command.rb b/lib/rubygems/commands/dependency_command.rb index e472d8fa8d..7d217076a5 100644 --- a/lib/rubygems/commands/dependency_command.rb +++ b/lib/rubygems/commands/dependency_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/local_remote_options' -require 'rubygems/version_option' +require_relative '../command' +require_relative '../local_remote_options' +require_relative '../version_option' class Gem::Commands::DependencyCommand < Gem::Command include Gem::LocalRemoteOptions diff --git a/lib/rubygems/commands/environment_command.rb b/lib/rubygems/commands/environment_command.rb index 37429fb836..b6eeb620bd 100644 --- a/lib/rubygems/commands/environment_command.rb +++ b/lib/rubygems/commands/environment_command.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/command' +require_relative '../command' class Gem::Commands::EnvironmentCommand < Gem::Command def initialize diff --git a/lib/rubygems/commands/fetch_command.rb b/lib/rubygems/commands/fetch_command.rb index 6a1b346dd3..619f56a5da 100644 --- a/lib/rubygems/commands/fetch_command.rb +++ b/lib/rubygems/commands/fetch_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/local_remote_options' -require 'rubygems/version_option' +require_relative '../command' +require_relative '../local_remote_options' +require_relative '../version_option' class Gem::Commands::FetchCommand < Gem::Command include Gem::LocalRemoteOptions diff --git a/lib/rubygems/commands/generate_index_command.rb b/lib/rubygems/commands/generate_index_command.rb index 93e25ef5e4..87200dab91 100644 --- a/lib/rubygems/commands/generate_index_command.rb +++ b/lib/rubygems/commands/generate_index_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/indexer' +require_relative '../command' +require_relative '../indexer' ## # Generates a index files for use as a gem server. diff --git a/lib/rubygems/commands/help_command.rb b/lib/rubygems/commands/help_command.rb index 4e8d7600fb..7f3383c9f3 100644 --- a/lib/rubygems/commands/help_command.rb +++ b/lib/rubygems/commands/help_command.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/command' +require_relative '../command' class Gem::Commands::HelpCommand < Gem::Command # :stopdoc: diff --git a/lib/rubygems/commands/info_command.rb b/lib/rubygems/commands/info_command.rb index 9ca6ae364f..3f2dd4ae0b 100644 --- a/lib/rubygems/commands/info_command.rb +++ b/lib/rubygems/commands/info_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/query_utils' +require_relative '../command' +require_relative '../query_utils' class Gem::Commands::InfoCommand < Gem::Command include Gem::QueryUtils diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb index 4d36c69d51..92430ea444 100644 --- a/lib/rubygems/commands/install_command.rb +++ b/lib/rubygems/commands/install_command.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/install_update_options' -require 'rubygems/dependency_installer' -require 'rubygems/local_remote_options' -require 'rubygems/validator' -require 'rubygems/version_option' +require_relative '../command' +require_relative '../install_update_options' +require_relative '../dependency_installer' +require_relative '../local_remote_options' +require_relative '../validator' +require_relative '../version_option' ## # Gem installer command line tool @@ -172,7 +172,7 @@ You can use `i` command instead of `install`. end def install_from_gemdeps # :nodoc: - require 'rubygems/request_set' + require_relative '../request_set' rs = Gem::RequestSet.new specs = rs.install_from_gemdeps options do |req, inst| @@ -247,11 +247,11 @@ You can use `i` command instead of `install`. def load_hooks # :nodoc: if options[:install_as_default] - require 'rubygems/install_default_message' + require_relative '../install_default_message' else - require 'rubygems/install_message' + require_relative '../install_message' end - require 'rubygems/rdoc' + require_relative '../rdoc' end def show_install_errors(errors) # :nodoc: diff --git a/lib/rubygems/commands/list_command.rb b/lib/rubygems/commands/list_command.rb index 5c99d3d73d..dea11111c9 100644 --- a/lib/rubygems/commands/list_command.rb +++ b/lib/rubygems/commands/list_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/query_utils' +require_relative '../command' +require_relative '../query_utils' ## # Searches for gems starting with the supplied argument. diff --git a/lib/rubygems/commands/lock_command.rb b/lib/rubygems/commands/lock_command.rb index f1dc1ac586..cb6229a2cb 100644 --- a/lib/rubygems/commands/lock_command.rb +++ b/lib/rubygems/commands/lock_command.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/command' +require_relative '../command' class Gem::Commands::LockCommand < Gem::Command def initialize diff --git a/lib/rubygems/commands/mirror_command.rb b/lib/rubygems/commands/mirror_command.rb index 86671a93b2..7daa47e2f0 100644 --- a/lib/rubygems/commands/mirror_command.rb +++ b/lib/rubygems/commands/mirror_command.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/command' +require_relative '../command' unless defined? Gem::Commands::MirrorCommand class Gem::Commands::MirrorCommand < Gem::Command diff --git a/lib/rubygems/commands/open_command.rb b/lib/rubygems/commands/open_command.rb index 8012a9a0e1..1e616fd68f 100644 --- a/lib/rubygems/commands/open_command.rb +++ b/lib/rubygems/commands/open_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/version_option' +require_relative '../command' +require_relative '../version_option' class Gem::Commands::OpenCommand < Gem::Command include Gem::VersionOption diff --git a/lib/rubygems/commands/outdated_command.rb b/lib/rubygems/commands/outdated_command.rb index 3579bfc3ba..162d338320 100644 --- a/lib/rubygems/commands/outdated_command.rb +++ b/lib/rubygems/commands/outdated_command.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/local_remote_options' -require 'rubygems/spec_fetcher' -require 'rubygems/version_option' +require_relative '../command' +require_relative '../local_remote_options' +require_relative '../spec_fetcher' +require_relative '../version_option' class Gem::Commands::OutdatedCommand < Gem::Command include Gem::LocalRemoteOptions diff --git a/lib/rubygems/commands/owner_command.rb b/lib/rubygems/commands/owner_command.rb index dd49027469..0a5665228f 100644 --- a/lib/rubygems/commands/owner_command.rb +++ b/lib/rubygems/commands/owner_command.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/local_remote_options' -require 'rubygems/gemcutter_utilities' -require 'rubygems/text' +require_relative '../command' +require_relative '../local_remote_options' +require_relative '../gemcutter_utilities' +require_relative '../text' class Gem::Commands::OwnerCommand < Gem::Command include Gem::Text diff --git a/lib/rubygems/commands/pristine_command.rb b/lib/rubygems/commands/pristine_command.rb index 143105981e..41547ce73b 100644 --- a/lib/rubygems/commands/pristine_command.rb +++ b/lib/rubygems/commands/pristine_command.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/package' -require 'rubygems/installer' -require 'rubygems/version_option' +require_relative '../command' +require_relative '../package' +require_relative '../installer' +require_relative '../version_option' class Gem::Commands::PristineCommand < Gem::Command include Gem::VersionOption @@ -138,7 +138,7 @@ extensions will be restored. gem = spec.cache_file unless File.exist? gem or options[:only_executables] or options[:only_plugins] - require 'rubygems/remote_fetcher' + require_relative '../remote_fetcher' say "Cached gem for #{spec.full_name} not found, attempting to fetch..." diff --git a/lib/rubygems/commands/push_command.rb b/lib/rubygems/commands/push_command.rb index 1a9a1932f8..1864b4b095 100644 --- a/lib/rubygems/commands/push_command.rb +++ b/lib/rubygems/commands/push_command.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/local_remote_options' -require 'rubygems/gemcutter_utilities' -require 'rubygems/package' +require_relative '../command' +require_relative '../local_remote_options' +require_relative '../gemcutter_utilities' +require_relative '../package' class Gem::Commands::PushCommand < Gem::Command include Gem::LocalRemoteOptions diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb index 789afd6509..5896bec44e 100644 --- a/lib/rubygems/commands/query_command.rb +++ b/lib/rubygems/commands/query_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/query_utils' -require 'rubygems/deprecate' +require_relative '../command' +require_relative '../query_utils' +require_relative '../deprecate' class Gem::Commands::QueryCommand < Gem::Command extend Gem::Deprecate diff --git a/lib/rubygems/commands/rdoc_command.rb b/lib/rubygems/commands/rdoc_command.rb index e8c9e84b29..305c80ccfe 100644 --- a/lib/rubygems/commands/rdoc_command.rb +++ b/lib/rubygems/commands/rdoc_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/version_option' -require 'rubygems/rdoc' +require_relative '../command' +require_relative '../version_option' +require_relative '../rdoc' require 'fileutils' class Gem::Commands::RdocCommand < Gem::Command diff --git a/lib/rubygems/commands/search_command.rb b/lib/rubygems/commands/search_command.rb index aeb2119235..488d777939 100644 --- a/lib/rubygems/commands/search_command.rb +++ b/lib/rubygems/commands/search_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/query_utils' +require_relative '../command' +require_relative '../query_utils' class Gem::Commands::SearchCommand < Gem::Command include Gem::QueryUtils diff --git a/lib/rubygems/commands/server_command.rb b/lib/rubygems/commands/server_command.rb index 594cf77f66..f3c08efb5e 100644 --- a/lib/rubygems/commands/server_command.rb +++ b/lib/rubygems/commands/server_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/server' -require 'rubygems/deprecate' +require_relative '../command' +require_relative '../server' +require_relative '../deprecate' class Gem::Commands::ServerCommand < Gem::Command extend Gem::Deprecate diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index 8b1098f63f..edb3498eec 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/command' +require_relative '../command' ## # Installs RubyGems itself. This command is ordinarily only available from a @@ -348,7 +348,7 @@ By default, this RubyGems will install gem as: rm_rf dir end - require 'rubygems/rdoc' + require_relative '../rdoc' fake_spec = Gem::Specification.new 'rubygems', Gem::VERSION def fake_spec.full_gem_path @@ -407,7 +407,7 @@ By default, this RubyGems will install gem as: cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_bin_dir, e) end - require 'rubygems/installer' + require_relative '../installer' Dir.chdir("bundler") do built_gem = Gem::Package.build(bundler_spec) @@ -584,7 +584,7 @@ abort "#{deprecation_message}" end def uninstall_old_gemcutter - require 'rubygems/uninstaller' + require_relative '../uninstaller' ui = Gem::Uninstaller.new('gemcutter', :all => true, :ignore => true, :version => '< 0.4') @@ -593,7 +593,7 @@ abort "#{deprecation_message}" end def regenerate_binstubs - require "rubygems/commands/pristine_command" + require_relative "pristine_command" say "Regenerating binstubs" args = %w[--all --only-executables --silent] diff --git a/lib/rubygems/commands/signin_command.rb b/lib/rubygems/commands/signin_command.rb index 2e19c8333c..23bb2f937f 100644 --- a/lib/rubygems/commands/signin_command.rb +++ b/lib/rubygems/commands/signin_command.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/gemcutter_utilities' +require_relative '../command' +require_relative '../gemcutter_utilities' class Gem::Commands::SigninCommand < Gem::Command include Gem::GemcutterUtilities diff --git a/lib/rubygems/commands/signout_command.rb b/lib/rubygems/commands/signout_command.rb index ebbe746cb4..c9485e0c1b 100644 --- a/lib/rubygems/commands/signout_command.rb +++ b/lib/rubygems/commands/signout_command.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/command' +require_relative '../command' class Gem::Commands::SignoutCommand < Gem::Command def initialize diff --git a/lib/rubygems/commands/sources_command.rb b/lib/rubygems/commands/sources_command.rb index f74fb12e42..9e74f3c47d 100644 --- a/lib/rubygems/commands/sources_command.rb +++ b/lib/rubygems/commands/sources_command.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/remote_fetcher' -require 'rubygems/spec_fetcher' -require 'rubygems/local_remote_options' +require_relative '../command' +require_relative '../remote_fetcher' +require_relative '../spec_fetcher' +require_relative '../local_remote_options' class Gem::Commands::SourcesCommand < Gem::Command include Gem::LocalRemoteOptions diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb index 3fddaaaf30..473b6e7b19 100644 --- a/lib/rubygems/commands/specification_command.rb +++ b/lib/rubygems/commands/specification_command.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/local_remote_options' -require 'rubygems/version_option' -require 'rubygems/package' +require_relative '../command' +require_relative '../local_remote_options' +require_relative '../version_option' +require_relative '../package' class Gem::Commands::SpecificationCommand < Gem::Command include Gem::LocalRemoteOptions diff --git a/lib/rubygems/commands/stale_command.rb b/lib/rubygems/commands/stale_command.rb index badc9905c1..62a97966f1 100644 --- a/lib/rubygems/commands/stale_command.rb +++ b/lib/rubygems/commands/stale_command.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/command' +require_relative '../command' class Gem::Commands::StaleCommand < Gem::Command def initialize diff --git a/lib/rubygems/commands/uninstall_command.rb b/lib/rubygems/commands/uninstall_command.rb index 1540b2f0fb..20781b224d 100644 --- a/lib/rubygems/commands/uninstall_command.rb +++ b/lib/rubygems/commands/uninstall_command.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/version_option' -require 'rubygems/uninstaller' +require_relative '../command' +require_relative '../version_option' +require_relative '../uninstaller' require 'fileutils' ## diff --git a/lib/rubygems/commands/unpack_command.rb b/lib/rubygems/commands/unpack_command.rb index 8d90d08eb4..3f1708375f 100644 --- a/lib/rubygems/commands/unpack_command.rb +++ b/lib/rubygems/commands/unpack_command.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/version_option' -require 'rubygems/security_option' -require 'rubygems/remote_fetcher' -require 'rubygems/package' +require_relative '../command' +require_relative '../version_option' +require_relative '../security_option' +require_relative '../remote_fetcher' +require_relative '../package' # forward-declare diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb index 91d93e398c..d104488c94 100644 --- a/lib/rubygems/commands/update_command.rb +++ b/lib/rubygems/commands/update_command.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/command_manager' -require 'rubygems/dependency_installer' -require 'rubygems/install_update_options' -require 'rubygems/local_remote_options' -require 'rubygems/spec_fetcher' -require 'rubygems/version_option' -require 'rubygems/install_message' # must come before rdoc for messaging -require 'rubygems/rdoc' +require_relative '../command' +require_relative '../command_manager' +require_relative '../dependency_installer' +require_relative '../install_update_options' +require_relative '../local_remote_options' +require_relative '../spec_fetcher' +require_relative '../version_option' +require_relative '../install_message' # must come before rdoc for messaging +require_relative '../rdoc' class Gem::Commands::UpdateCommand < Gem::Command include Gem::InstallUpdateOptions diff --git a/lib/rubygems/commands/which_command.rb b/lib/rubygems/commands/which_command.rb index d42ab18395..44e87a2b98 100644 --- a/lib/rubygems/commands/which_command.rb +++ b/lib/rubygems/commands/which_command.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/command' +require_relative '../command' class Gem::Commands::WhichCommand < Gem::Command def initialize diff --git a/lib/rubygems/commands/yank_command.rb b/lib/rubygems/commands/yank_command.rb index a7930253d6..cad78aec5f 100644 --- a/lib/rubygems/commands/yank_command.rb +++ b/lib/rubygems/commands/yank_command.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -require 'rubygems/command' -require 'rubygems/local_remote_options' -require 'rubygems/version_option' -require 'rubygems/gemcutter_utilities' +require_relative '../command' +require_relative '../local_remote_options' +require_relative '../version_option' +require_relative '../gemcutter_utilities' class Gem::Commands::YankCommand < Gem::Command include Gem::LocalRemoteOptions diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index 02bb2be122..60c1d50ba9 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -5,7 +5,7 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems/user_interaction' +require_relative 'user_interaction' require 'rbconfig' ## diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb index 400a5de5cf..913bba32eb 100644 --- a/lib/rubygems/dependency_installer.rb +++ b/lib/rubygems/dependency_installer.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -require 'rubygems' -require 'rubygems/dependency_list' -require 'rubygems/package' -require 'rubygems/installer' -require 'rubygems/spec_fetcher' -require 'rubygems/user_interaction' -require 'rubygems/available_set' -require 'rubygems/deprecate' +require_relative '../rubygems' +require_relative 'dependency_list' +require_relative 'package' +require_relative 'installer' +require_relative 'spec_fetcher' +require_relative 'user_interaction' +require_relative 'available_set' +require_relative 'deprecate' ## # Installs a gem along with all its dependencies from local and remote gems. diff --git a/lib/rubygems/dependency_list.rb b/lib/rubygems/dependency_list.rb index bcf436cd03..8f61869874 100644 --- a/lib/rubygems/dependency_list.rb +++ b/lib/rubygems/dependency_list.rb @@ -6,7 +6,7 @@ #++ require 'tsort' -require 'rubygems/deprecate' +require_relative 'deprecate' ## # Gem::DependencyList is used for installing and uninstalling gems in the diff --git a/lib/rubygems/doctor.rb b/lib/rubygems/doctor.rb index ef31aeddd0..41bcda9804 100644 --- a/lib/rubygems/doctor.rb +++ b/lib/rubygems/doctor.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems' -require 'rubygems/user_interaction' +require_relative '../rubygems' +require_relative 'user_interaction' ## # Cleans up after a partially-failed uninstall or for an invalid diff --git a/lib/rubygems/exceptions.rb b/lib/rubygems/exceptions.rb index 185efdb6ab..f0debb646f 100644 --- a/lib/rubygems/exceptions.rb +++ b/lib/rubygems/exceptions.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/deprecate' -require 'rubygems/unknown_command_spell_checker' +require_relative 'deprecate' +require_relative 'unknown_command_spell_checker' ## # Base exception class for RubyGems. All exception raised by RubyGems are a diff --git a/lib/rubygems/gem_runner.rb b/lib/rubygems/gem_runner.rb index a36674503e..55b5a7d067 100644 --- a/lib/rubygems/gem_runner.rb +++ b/lib/rubygems/gem_runner.rb @@ -5,9 +5,9 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems' -require 'rubygems/command_manager' -require 'rubygems/deprecate' +require_relative '../rubygems' +require_relative 'command_manager' +require_relative 'deprecate' ## # Load additional plugins from $LOAD_PATH diff --git a/lib/rubygems/gemcutter_utilities.rb b/lib/rubygems/gemcutter_utilities.rb index f465881041..0968e1a6f9 100644 --- a/lib/rubygems/gemcutter_utilities.rb +++ b/lib/rubygems/gemcutter_utilities.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems/remote_fetcher' -require 'rubygems/text' +require_relative 'remote_fetcher' +require_relative 'text' ## # Utility methods for using the RubyGems API. diff --git a/lib/rubygems/indexer.rb b/lib/rubygems/indexer.rb index e595459c87..6e8dade640 100644 --- a/lib/rubygems/indexer.rb +++ b/lib/rubygems/indexer.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems' -require 'rubygems/package' +require_relative '../rubygems' +require_relative 'package' require 'tmpdir' ## diff --git a/lib/rubygems/install_default_message.rb b/lib/rubygems/install_default_message.rb index f68fd2fd04..052ef528e1 100644 --- a/lib/rubygems/install_default_message.rb +++ b/lib/rubygems/install_default_message.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems' -require 'rubygems/user_interaction' +require_relative '../rubygems' +require_relative 'user_interaction' ## # A post-install hook that displays "Successfully installed diff --git a/lib/rubygems/install_message.rb b/lib/rubygems/install_message.rb index 3c13888a84..861ead3770 100644 --- a/lib/rubygems/install_message.rb +++ b/lib/rubygems/install_message.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'rubygems' -require 'rubygems/user_interaction' +require_relative '../rubygems' +require_relative 'user_interaction' ## # A default post-install hook that displays "Successfully installed diff --git a/lib/rubygems/install_update_options.rb b/lib/rubygems/install_update_options.rb index 54a3950b64..cafa63544f 100644 --- a/lib/rubygems/install_update_options.rb +++ b/lib/rubygems/install_update_options.rb @@ -5,8 +5,8 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems' -require 'rubygems/security_option' +require_relative '../rubygems' +require_relative 'security_option' ## # Mixin methods for install and update options for Gem::Commands diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index 6ab1f517d7..cf5ed7b502 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -5,13 +5,13 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems/command' -require 'rubygems/installer_uninstaller_utils' -require 'rubygems/exceptions' -require 'rubygems/deprecate' -require 'rubygems/package' -require 'rubygems/ext' -require 'rubygems/user_interaction' +require_relative 'command' +require_relative 'installer_uninstaller_utils' +require_relative 'exceptions' +require_relative 'deprecate' +require_relative 'package' +require_relative 'ext' +require_relative 'user_interaction' ## # The installer installs the files contained in the .gem into the Gem.home. diff --git a/lib/rubygems/local_remote_options.rb b/lib/rubygems/local_remote_options.rb index 2d0509eb03..8acd98d2e4 100644 --- a/lib/rubygems/local_remote_options.rb +++ b/lib/rubygems/local_remote_options.rb @@ -6,7 +6,7 @@ #++ require 'uri' -require 'rubygems' +require_relative '../rubygems' ## # Mixin methods for local and remote Gem::Command options. diff --git a/lib/rubygems/mock_gem_ui.rb b/lib/rubygems/mock_gem_ui.rb index ec244fb7c6..914ecb9a71 100644 --- a/lib/rubygems/mock_gem_ui.rb +++ b/lib/rubygems/mock_gem_ui.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/user_interaction' +require_relative 'user_interaction' ## # This Gem::StreamUI subclass records input and output to StringIO for diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index a4ae3e9ea5..c4b29e4176 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -41,9 +41,9 @@ # #files are the files in the .gem tar file, not the Ruby files in the gem # #extract_files and #contents automatically call #verify -require "rubygems" -require 'rubygems/security' -require 'rubygems/user_interaction' +require_relative "../rubygems" +require_relative 'security' +require_relative 'user_interaction' class Gem::Package include Gem::UserInteraction @@ -702,12 +702,12 @@ EOM end end -require 'rubygems/package/digest_io' -require 'rubygems/package/source' -require 'rubygems/package/file_source' -require 'rubygems/package/io_source' -require 'rubygems/package/old' -require 'rubygems/package/tar_header' -require 'rubygems/package/tar_reader' -require 'rubygems/package/tar_reader/entry' -require 'rubygems/package/tar_writer' +require_relative 'package/digest_io' +require_relative 'package/source' +require_relative 'package/file_source' +require_relative 'package/io_source' +require_relative 'package/old' +require_relative 'package/tar_header' +require_relative 'package/tar_reader' +require_relative 'package/tar_reader/entry' +require_relative 'package/tar_writer' diff --git a/lib/rubygems/package/tar_reader.rb b/lib/rubygems/package/tar_reader.rb index e7c5620533..41121f3bfb 100644 --- a/lib/rubygems/package/tar_reader.rb +++ b/lib/rubygems/package/tar_reader.rb @@ -121,4 +121,4 @@ class Gem::Package::TarReader end end -require 'rubygems/package/tar_reader/entry' +require_relative 'tar_reader/entry' diff --git a/lib/rubygems/package_task.rb b/lib/rubygems/package_task.rb index d5a2885a64..bb48616b0e 100644 --- a/lib/rubygems/package_task.rb +++ b/lib/rubygems/package_task.rb @@ -20,8 +20,8 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -require 'rubygems' -require 'rubygems/package' +require_relative '../rubygems' +require_relative 'package' require 'rake/packagetask' ## diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb index fd1c0a62ac..9750df181b 100644 --- a/lib/rubygems/platform.rb +++ b/lib/rubygems/platform.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "rubygems/deprecate" +require_relative "deprecate" ## # Available list of platforms for targeting Gem installations. diff --git a/lib/rubygems/rdoc.rb b/lib/rubygems/rdoc.rb index c40bb7d9f1..ac5e8f0822 100644 --- a/lib/rubygems/rdoc.rb +++ b/lib/rubygems/rdoc.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems' +require_relative '../rubygems' begin require 'rdoc/rubygems_hook' diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb index 45dca1195e..8c9c9e6150 100644 --- a/lib/rubygems/remote_fetcher.rb +++ b/lib/rubygems/remote_fetcher.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'rubygems' -require 'rubygems/request' -require 'rubygems/request/connection_pools' -require 'rubygems/s3_uri_signer' -require 'rubygems/uri_formatter' -require 'rubygems/uri_parser' -require 'rubygems/user_interaction' +require_relative '../rubygems' +require_relative 'request' +require_relative 'request/connection_pools' +require_relative 's3_uri_signer' +require_relative 'uri_formatter' +require_relative 'uri_parser' +require_relative 'user_interaction' ## # RemoteFetcher handles the details of fetching gems and gem information from diff --git a/lib/rubygems/request.rb b/lib/rubygems/request.rb index 5bda0b2e5e..16a368e5ae 100644 --- a/lib/rubygems/request.rb +++ b/lib/rubygems/request.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true require 'net/http' -require 'rubygems/user_interaction' +require_relative 'user_interaction' class Gem::Request extend Gem::UserInteraction @@ -287,6 +287,6 @@ class Gem::Request end end -require 'rubygems/request/http_pool' -require 'rubygems/request/https_pool' -require 'rubygems/request/connection_pools' +require_relative 'request/http_pool' +require_relative 'request/https_pool' +require_relative 'request/connection_pools' diff --git a/lib/rubygems/request_set.rb b/lib/rubygems/request_set.rb index 36ec87e1f7..9286c54221 100644 --- a/lib/rubygems/request_set.rb +++ b/lib/rubygems/request_set.rb @@ -303,7 +303,7 @@ class Gem::RequestSet end end - require "rubygems/dependency_installer" + require_relative "dependency_installer" inst = Gem::DependencyInstaller.new options inst.installed_gems.replace specs @@ -461,6 +461,6 @@ class Gem::RequestSet end end -require 'rubygems/request_set/gem_dependency_api' -require 'rubygems/request_set/lockfile' -require 'rubygems/request_set/lockfile/tokenizer' +require_relative 'request_set/gem_dependency_api' +require_relative 'request_set/lockfile' +require_relative 'request_set/lockfile/tokenizer' diff --git a/lib/rubygems/request_set/lockfile.rb b/lib/rubygems/request_set/lockfile.rb index 8f8f142fff..bec29ef1b9 100644 --- a/lib/rubygems/request_set/lockfile.rb +++ b/lib/rubygems/request_set/lockfile.rb @@ -236,4 +236,4 @@ class Gem::RequestSet::Lockfile end end -require 'rubygems/request_set/lockfile/tokenizer' +require_relative 'lockfile/tokenizer' diff --git a/lib/rubygems/request_set/lockfile/tokenizer.rb b/lib/rubygems/request_set/lockfile/tokenizer.rb index 6918e8e1a5..cb8030c143 100644 --- a/lib/rubygems/request_set/lockfile/tokenizer.rb +++ b/lib/rubygems/request_set/lockfile/tokenizer.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/request_set/lockfile/parser' +require_relative 'parser' class Gem::RequestSet::Lockfile::Tokenizer Token = Struct.new :type, :value, :column, :line diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb index 16de45ad91..d2e28fab5b 100644 --- a/lib/rubygems/requirement.rb +++ b/lib/rubygems/requirement.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "rubygems/deprecate" +require_relative "deprecate" ## # A Requirement is a set of one or more version restrictions. It supports a diff --git a/lib/rubygems/resolver.rb b/lib/rubygems/resolver.rb index 71c35ea3d3..51a11fed47 100644 --- a/lib/rubygems/resolver.rb +++ b/lib/rubygems/resolver.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'rubygems/dependency' -require 'rubygems/exceptions' -require 'rubygems/util/list' +require_relative 'dependency' +require_relative 'exceptions' +require_relative 'util/list' ## # Given a set of Gem::Dependency objects as +needed+ and a way to query the @@ -10,7 +10,7 @@ require 'rubygems/util/list' # all the requirements. class Gem::Resolver - require 'rubygems/resolver/molinillo' + require_relative 'resolver/molinillo' ## # If the DEBUG_RESOLVER environment variable is set then debugging mode is @@ -318,30 +318,30 @@ class Gem::Resolver private :amount_constrained end -require 'rubygems/resolver/activation_request' -require 'rubygems/resolver/conflict' -require 'rubygems/resolver/dependency_request' -require 'rubygems/resolver/requirement_list' -require 'rubygems/resolver/stats' +require_relative 'resolver/activation_request' +require_relative 'resolver/conflict' +require_relative 'resolver/dependency_request' +require_relative 'resolver/requirement_list' +require_relative 'resolver/stats' -require 'rubygems/resolver/set' -require 'rubygems/resolver/api_set' -require 'rubygems/resolver/composed_set' -require 'rubygems/resolver/best_set' -require 'rubygems/resolver/current_set' -require 'rubygems/resolver/git_set' -require 'rubygems/resolver/index_set' -require 'rubygems/resolver/installer_set' -require 'rubygems/resolver/lock_set' -require 'rubygems/resolver/vendor_set' -require 'rubygems/resolver/source_set' +require_relative 'resolver/set' +require_relative 'resolver/api_set' +require_relative 'resolver/composed_set' +require_relative 'resolver/best_set' +require_relative 'resolver/current_set' +require_relative 'resolver/git_set' +require_relative 'resolver/index_set' +require_relative 'resolver/installer_set' +require_relative 'resolver/lock_set' +require_relative 'resolver/vendor_set' +require_relative 'resolver/source_set' -require 'rubygems/resolver/specification' -require 'rubygems/resolver/spec_specification' -require 'rubygems/resolver/api_specification' -require 'rubygems/resolver/git_specification' -require 'rubygems/resolver/index_specification' -require 'rubygems/resolver/installed_specification' -require 'rubygems/resolver/local_specification' -require 'rubygems/resolver/lock_specification' -require 'rubygems/resolver/vendor_specification' +require_relative 'resolver/specification' +require_relative 'resolver/spec_specification' +require_relative 'resolver/api_specification' +require_relative 'resolver/git_specification' +require_relative 'resolver/index_specification' +require_relative 'resolver/installed_specification' +require_relative 'resolver/local_specification' +require_relative 'resolver/lock_specification' +require_relative 'resolver/vendor_specification' diff --git a/lib/rubygems/resolver/git_specification.rb b/lib/rubygems/resolver/git_specification.rb index 555dcffc22..ee47080ab4 100644 --- a/lib/rubygems/resolver/git_specification.rb +++ b/lib/rubygems/resolver/git_specification.rb @@ -21,7 +21,7 @@ class Gem::Resolver::GitSpecification < Gem::Resolver::SpecSpecification # the executables. def install(options = {}) - require 'rubygems/installer' + require_relative '../installer' installer = Gem::Installer.for_spec spec, options diff --git a/lib/rubygems/resolver/molinillo.rb b/lib/rubygems/resolver/molinillo.rb index 2357f41bee..12ca740e5a 100644 --- a/lib/rubygems/resolver/molinillo.rb +++ b/lib/rubygems/resolver/molinillo.rb @@ -1,2 +1,2 @@ # frozen_string_literal: true -require 'rubygems/resolver/molinillo/lib/molinillo' +require_relative 'molinillo/lib/molinillo' diff --git a/lib/rubygems/resolver/specification.rb b/lib/rubygems/resolver/specification.rb index 8c6fc9afcf..dfcb7eb057 100644 --- a/lib/rubygems/resolver/specification.rb +++ b/lib/rubygems/resolver/specification.rb @@ -93,7 +93,7 @@ class Gem::Resolver::Specification # specification. def install(options = {}) - require 'rubygems/installer' + require_relative '../installer' gem = download options diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb index c80639af6d..28f705549c 100644 --- a/lib/rubygems/security.rb +++ b/lib/rubygems/security.rb @@ -5,7 +5,7 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems/exceptions' +require_relative 'exceptions' require_relative 'openssl' ## @@ -592,9 +592,9 @@ module Gem::Security end if Gem::HAVE_OPENSSL - require 'rubygems/security/policy' - require 'rubygems/security/policies' - require 'rubygems/security/trust_dir' + require_relative 'security/policy' + require_relative 'security/policies' + require_relative 'security/trust_dir' end -require 'rubygems/security/signer' +require_relative 'security/signer' diff --git a/lib/rubygems/security/policy.rb b/lib/rubygems/security/policy.rb index 7629d64796..9683e55b32 100644 --- a/lib/rubygems/security/policy.rb +++ b/lib/rubygems/security/policy.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/user_interaction' +require_relative '../user_interaction' ## # A Gem::Security::Policy object encapsulates the settings for verifying diff --git a/lib/rubygems/security/signer.rb b/lib/rubygems/security/signer.rb index 6c85ab08d2..c5c2c4f220 100644 --- a/lib/rubygems/security/signer.rb +++ b/lib/rubygems/security/signer.rb @@ -2,7 +2,7 @@ ## # Basic OpenSSL-based package signing class. -require "rubygems/user_interaction" +require_relative "../user_interaction" class Gem::Security::Signer include Gem::UserInteraction diff --git a/lib/rubygems/security_option.rb b/lib/rubygems/security_option.rb index 3403aaaf05..6c75d6ecb4 100644 --- a/lib/rubygems/security_option.rb +++ b/lib/rubygems/security_option.rb @@ -5,7 +5,7 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems' +require_relative '../rubygems' # forward-declare @@ -20,7 +20,7 @@ end module Gem::SecurityOption def add_security_option OptionParser.accept Gem::Security::Policy do |value| - require 'rubygems/security' + require_relative 'security' raise OptionParser::InvalidArgument, 'OpenSSL not installed' unless defined?(Gem::Security::HighSecurity) diff --git a/lib/rubygems/server.rb b/lib/rubygems/server.rb index 2c2805f31c..45be05bcda 100644 --- a/lib/rubygems/server.rb +++ b/lib/rubygems/server.rb @@ -3,8 +3,8 @@ require 'zlib' require 'erb' require 'uri' -require 'rubygems' -require 'rubygems/rdoc' +require_relative '../rubygems' +require_relative 'rdoc' ## # Gem::Server and allows users to serve gems for consumption by diff --git a/lib/rubygems/source.rb b/lib/rubygems/source.rb index 37e03cdfae..a9d91ed18e 100644 --- a/lib/rubygems/source.rb +++ b/lib/rubygems/source.rb @@ -240,9 +240,9 @@ class Gem::Source end end -require 'rubygems/source/git' -require 'rubygems/source/installed' -require 'rubygems/source/specific_file' -require 'rubygems/source/local' -require 'rubygems/source/lock' -require 'rubygems/source/vendor' +require_relative 'source/git' +require_relative 'source/installed' +require_relative 'source/specific_file' +require_relative 'source/local' +require_relative 'source/lock' +require_relative 'source/vendor' diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb index b2bcadc49c..68ff605a83 100644 --- a/lib/rubygems/spec_fetcher.rb +++ b/lib/rubygems/spec_fetcher.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -require 'rubygems/remote_fetcher' -require 'rubygems/user_interaction' -require 'rubygems/errors' -require 'rubygems/text' -require 'rubygems/name_tuple' +require_relative 'remote_fetcher' +require_relative 'user_interaction' +require_relative 'errors' +require_relative 'text' +require_relative 'name_tuple' ## # SpecFetcher handles metadata updates from remote gem repositories. diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index ff345bf7a3..83277fd281 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -6,11 +6,11 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems/deprecate' -require 'rubygems/basic_specification' -require 'rubygems/stub_specification' -require 'rubygems/specification_policy' -require 'rubygems/util/list' +require_relative 'deprecate' +require_relative 'basic_specification' +require_relative 'stub_specification' +require_relative 'specification_policy' +require_relative 'util/list' ## # The Specification class contains the information for a gem. Typically @@ -1568,9 +1568,9 @@ class Gem::Specification < Gem::BasicSpecification unresolved_deps = Gem::Specification.unresolved_deps.dup Gem::Specification.unresolved_deps.clear - require 'rubygems/config_file' - require 'rubygems/ext' - require 'rubygems/user_interaction' + require_relative 'config_file' + require_relative 'ext' + require_relative 'user_interaction' ui = Gem::SilentUI.new Gem::DefaultUserInteraction.use_ui ui do @@ -2525,7 +2525,7 @@ class Gem::Specification < Gem::BasicSpecification # back, we have to check again here to make sure that our # psych code was properly loaded, and load it if not. unless Gem.const_defined?(:NoAliasYAMLTree) - require 'rubygems/psych_tree' + require_relative 'psych_tree' end builder = Gem::NoAliasYAMLTree.create diff --git a/lib/rubygems/specification_policy.rb b/lib/rubygems/specification_policy.rb index 86277a2058..1f1f73b11f 100644 --- a/lib/rubygems/specification_policy.rb +++ b/lib/rubygems/specification_policy.rb @@ -1,4 +1,4 @@ -require 'rubygems/user_interaction' +require_relative 'user_interaction' class Gem::SpecificationPolicy include Gem::UserInteraction diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb index 87a5ef770f..11fb611329 100644 --- a/lib/rubygems/uninstaller.rb +++ b/lib/rubygems/uninstaller.rb @@ -6,11 +6,11 @@ #++ require 'fileutils' -require 'rubygems' -require 'rubygems/installer_uninstaller_utils' -require 'rubygems/dependency_list' -require 'rubygems/rdoc' -require 'rubygems/user_interaction' +require_relative '../rubygems' +require_relative 'installer_uninstaller_utils' +require_relative 'dependency_list' +require_relative 'rdoc' +require_relative 'user_interaction' ## # An Uninstaller. @@ -360,7 +360,7 @@ class Gem::Uninstaller # of what it did for us to find rather than trying to recreate # it again. if @format_executable - require 'rubygems/installer' + require_relative 'installer' Gem::Installer.exec_format % File.basename(filename) else filename diff --git a/lib/rubygems/user_interaction.rb b/lib/rubygems/user_interaction.rb index 6376ea7cf8..0ab44fbf6c 100644 --- a/lib/rubygems/user_interaction.rb +++ b/lib/rubygems/user_interaction.rb @@ -5,8 +5,8 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems/deprecate' -require 'rubygems/text' +require_relative 'deprecate' +require_relative 'text' ## # Module that defines the default UserInteraction. Any class including this diff --git a/lib/rubygems/util/licenses.rb b/lib/rubygems/util/licenses.rb index 98cbd8929b..8de5b11ae3 100644 --- a/lib/rubygems/util/licenses.rb +++ b/lib/rubygems/util/licenses.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require 'rubygems/text' +require_relative '../text' class Gem::Licenses extend Gem::Text diff --git a/lib/rubygems/validator.rb b/lib/rubygems/validator.rb index 30cdd93b5c..728595e778 100644 --- a/lib/rubygems/validator.rb +++ b/lib/rubygems/validator.rb @@ -5,8 +5,8 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems/package' -require 'rubygems/installer' +require_relative 'package' +require_relative 'installer' ## # Validator performs various gem file and gem database validation diff --git a/lib/rubygems/version_option.rb b/lib/rubygems/version_option.rb index be71ef409b..eabe4fdb57 100644 --- a/lib/rubygems/version_option.rb +++ b/lib/rubygems/version_option.rb @@ -5,7 +5,7 @@ # See LICENSE.txt for permissions. #++ -require 'rubygems' +require_relative '../rubygems' ## # Mixin methods for --version and --platform Gem::Command options.