[rubygems/rubygems] Prefer `require_relative` to `require` for internal requires

https://github.com/rubygems/rubygems/commit/c74fc58695
This commit is contained in:
David Rodríguez 2019-04-22 13:56:16 +02:00 коммит произвёл Hiroshi SHIBATA
Родитель f6803d2411
Коммит 54ae3f587e
80 изменённых файлов: 273 добавлений и 273 удалений

Просмотреть файл

@ -12,11 +12,11 @@ module Gem
end end
# Must be first since it unloads the prelude from 1.9.2 # Must be first since it unloads the prelude from 1.9.2
require 'rubygems/compatibility' require_relative 'rubygems/compatibility'
require 'rubygems/defaults' require_relative 'rubygems/defaults'
require 'rubygems/deprecate' require_relative 'rubygems/deprecate'
require 'rubygems/errors' require_relative 'rubygems/errors'
## ##
# RubyGems is the Ruby standard for publishing and managing third party # 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]}
# => [#<Gem::Specification:0x1013b4528 @name="minitest", ...>] # => [#<Gem::Specification:0x1013b4528 @name="minitest", ...>]
def self.install(name, version = Gem::Requirement.default, *options) def self.install(name, version = Gem::Requirement.default, *options)
require "rubygems/dependency_installer" require_relative "rubygems/dependency_installer"
inst = Gem::DependencyInstaller.new(*options) inst = Gem::DependencyInstaller.new(*options)
inst.install name, version inst.install name, version
inst.installed_gems inst.installed_gems
@ -625,12 +625,12 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
rescue ::LoadError rescue ::LoadError
# If we can't load psych, that's fine, go on. # If we can't load psych, that's fine, go on.
else else
require 'rubygems/psych_additions' require_relative 'rubygems/psych_additions'
require 'rubygems/psych_tree' require_relative 'rubygems/psych_tree'
end end
require 'yaml' require 'yaml'
require 'rubygems/safe_yaml' require_relative 'rubygems/safe_yaml'
@yaml_loaded = true @yaml_loaded = true
end end
@ -990,7 +990,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# Lazily loads DefaultUserInteraction and returns the default UI. # Lazily loads DefaultUserInteraction and returns the default UI.
def self.ui def self.ui
require 'rubygems/user_interaction' require_relative 'rubygems/user_interaction'
Gem::DefaultUserInteraction.ui Gem::DefaultUserInteraction.ui
end end
@ -1110,7 +1110,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
end end
ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path) ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path)
require 'rubygems/user_interaction' require_relative 'rubygems/user_interaction'
require "bundler" require "bundler"
begin begin
Gem::DefaultUserInteraction.use_ui(ui) do 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__) autoload :Version, File.expand_path('rubygems/version', __dir__)
end end
require 'rubygems/exceptions' require_relative 'rubygems/exceptions'
# REFACTOR: This should be pulled out into some kind of hacks file. # REFACTOR: This should be pulled out into some kind of hacks file.
begin begin
@ -1353,6 +1353,6 @@ end
# Loads the default specs. # Loads the default specs.
Gem::Specification.load_defaults Gem::Specification.load_defaults
require 'rubygems/core_ext/kernel_gem' require_relative 'rubygems/core_ext/kernel_gem'
require 'rubygems/core_ext/kernel_require' require_relative 'rubygems/core_ext/kernel_require'
require 'rubygems/core_ext/kernel_warn' require_relative 'rubygems/core_ext/kernel_warn'

Просмотреть файл

@ -5,9 +5,9 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems/command' require_relative 'command'
require 'rubygems/user_interaction' require_relative 'user_interaction'
require 'rubygems/text' require_relative 'text'
## ##
# The command manager registers and installs all the individual sub-commands # The command manager registers and installs all the individual sub-commands

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/package' require_relative '../package'
require 'rubygems/version_option' require_relative '../version_option'
class Gem::Commands::BuildCommand < Gem::Command class Gem::Commands::BuildCommand < Gem::Command
include Gem::VersionOption include Gem::VersionOption

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/security' require_relative '../security'
class Gem::Commands::CertCommand < Gem::Command class Gem::Commands::CertCommand < Gem::Command
def initialize def initialize

Просмотреть файл

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/version_option' require_relative '../version_option'
require 'rubygems/validator' require_relative '../validator'
require 'rubygems/doctor' require_relative '../doctor'
class Gem::Commands::CheckCommand < Gem::Command class Gem::Commands::CheckCommand < Gem::Command
include Gem::VersionOption include Gem::VersionOption

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/dependency_list' require_relative '../dependency_list'
require 'rubygems/uninstaller' require_relative '../uninstaller'
class Gem::Commands::CleanupCommand < Gem::Command class Gem::Commands::CleanupCommand < Gem::Command
def initialize def initialize

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/version_option' require_relative '../version_option'
class Gem::Commands::ContentsCommand < Gem::Command class Gem::Commands::ContentsCommand < Gem::Command
include Gem::VersionOption include Gem::VersionOption

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
require 'rubygems/version_option' require_relative '../version_option'
class Gem::Commands::DependencyCommand < Gem::Command class Gem::Commands::DependencyCommand < Gem::Command
include Gem::LocalRemoteOptions include Gem::LocalRemoteOptions

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
class Gem::Commands::EnvironmentCommand < Gem::Command class Gem::Commands::EnvironmentCommand < Gem::Command
def initialize def initialize

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
require 'rubygems/version_option' require_relative '../version_option'
class Gem::Commands::FetchCommand < Gem::Command class Gem::Commands::FetchCommand < Gem::Command
include Gem::LocalRemoteOptions include Gem::LocalRemoteOptions

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/indexer' require_relative '../indexer'
## ##
# Generates a index files for use as a gem server. # Generates a index files for use as a gem server.

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
class Gem::Commands::HelpCommand < Gem::Command class Gem::Commands::HelpCommand < Gem::Command
# :stopdoc: # :stopdoc:

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/query_utils' require_relative '../query_utils'
class Gem::Commands::InfoCommand < Gem::Command class Gem::Commands::InfoCommand < Gem::Command
include Gem::QueryUtils include Gem::QueryUtils

Просмотреть файл

@ -1,10 +1,10 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/install_update_options' require_relative '../install_update_options'
require 'rubygems/dependency_installer' require_relative '../dependency_installer'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
require 'rubygems/validator' require_relative '../validator'
require 'rubygems/version_option' require_relative '../version_option'
## ##
# Gem installer command line tool # Gem installer command line tool
@ -172,7 +172,7 @@ You can use `i` command instead of `install`.
end end
def install_from_gemdeps # :nodoc: def install_from_gemdeps # :nodoc:
require 'rubygems/request_set' require_relative '../request_set'
rs = Gem::RequestSet.new rs = Gem::RequestSet.new
specs = rs.install_from_gemdeps options do |req, inst| 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: def load_hooks # :nodoc:
if options[:install_as_default] if options[:install_as_default]
require 'rubygems/install_default_message' require_relative '../install_default_message'
else else
require 'rubygems/install_message' require_relative '../install_message'
end end
require 'rubygems/rdoc' require_relative '../rdoc'
end end
def show_install_errors(errors) # :nodoc: def show_install_errors(errors) # :nodoc:

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/query_utils' require_relative '../query_utils'
## ##
# Searches for gems starting with the supplied argument. # Searches for gems starting with the supplied argument.

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
class Gem::Commands::LockCommand < Gem::Command class Gem::Commands::LockCommand < Gem::Command
def initialize def initialize

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
unless defined? Gem::Commands::MirrorCommand unless defined? Gem::Commands::MirrorCommand
class Gem::Commands::MirrorCommand < Gem::Command class Gem::Commands::MirrorCommand < Gem::Command

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/version_option' require_relative '../version_option'
class Gem::Commands::OpenCommand < Gem::Command class Gem::Commands::OpenCommand < Gem::Command
include Gem::VersionOption include Gem::VersionOption

Просмотреть файл

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
require 'rubygems/spec_fetcher' require_relative '../spec_fetcher'
require 'rubygems/version_option' require_relative '../version_option'
class Gem::Commands::OutdatedCommand < Gem::Command class Gem::Commands::OutdatedCommand < Gem::Command
include Gem::LocalRemoteOptions include Gem::LocalRemoteOptions

Просмотреть файл

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
require 'rubygems/gemcutter_utilities' require_relative '../gemcutter_utilities'
require 'rubygems/text' require_relative '../text'
class Gem::Commands::OwnerCommand < Gem::Command class Gem::Commands::OwnerCommand < Gem::Command
include Gem::Text include Gem::Text

Просмотреть файл

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/package' require_relative '../package'
require 'rubygems/installer' require_relative '../installer'
require 'rubygems/version_option' require_relative '../version_option'
class Gem::Commands::PristineCommand < Gem::Command class Gem::Commands::PristineCommand < Gem::Command
include Gem::VersionOption include Gem::VersionOption
@ -138,7 +138,7 @@ extensions will be restored.
gem = spec.cache_file gem = spec.cache_file
unless File.exist? gem or options[:only_executables] or options[:only_plugins] 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..." say "Cached gem for #{spec.full_name} not found, attempting to fetch..."

Просмотреть файл

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
require 'rubygems/gemcutter_utilities' require_relative '../gemcutter_utilities'
require 'rubygems/package' require_relative '../package'
class Gem::Commands::PushCommand < Gem::Command class Gem::Commands::PushCommand < Gem::Command
include Gem::LocalRemoteOptions include Gem::LocalRemoteOptions

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/query_utils' require_relative '../query_utils'
require 'rubygems/deprecate' require_relative '../deprecate'
class Gem::Commands::QueryCommand < Gem::Command class Gem::Commands::QueryCommand < Gem::Command
extend Gem::Deprecate extend Gem::Deprecate

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/version_option' require_relative '../version_option'
require 'rubygems/rdoc' require_relative '../rdoc'
require 'fileutils' require 'fileutils'
class Gem::Commands::RdocCommand < Gem::Command class Gem::Commands::RdocCommand < Gem::Command

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/query_utils' require_relative '../query_utils'
class Gem::Commands::SearchCommand < Gem::Command class Gem::Commands::SearchCommand < Gem::Command
include Gem::QueryUtils include Gem::QueryUtils

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/server' require_relative '../server'
require 'rubygems/deprecate' require_relative '../deprecate'
class Gem::Commands::ServerCommand < Gem::Command class Gem::Commands::ServerCommand < Gem::Command
extend Gem::Deprecate extend Gem::Deprecate

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
## ##
# Installs RubyGems itself. This command is ordinarily only available from a # 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 rm_rf dir
end end
require 'rubygems/rdoc' require_relative '../rdoc'
fake_spec = Gem::Specification.new 'rubygems', Gem::VERSION fake_spec = Gem::Specification.new 'rubygems', Gem::VERSION
def fake_spec.full_gem_path 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) cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_bin_dir, e)
end end
require 'rubygems/installer' require_relative '../installer'
Dir.chdir("bundler") do Dir.chdir("bundler") do
built_gem = Gem::Package.build(bundler_spec) built_gem = Gem::Package.build(bundler_spec)
@ -584,7 +584,7 @@ abort "#{deprecation_message}"
end end
def uninstall_old_gemcutter def uninstall_old_gemcutter
require 'rubygems/uninstaller' require_relative '../uninstaller'
ui = Gem::Uninstaller.new('gemcutter', :all => true, :ignore => true, ui = Gem::Uninstaller.new('gemcutter', :all => true, :ignore => true,
:version => '< 0.4') :version => '< 0.4')
@ -593,7 +593,7 @@ abort "#{deprecation_message}"
end end
def regenerate_binstubs def regenerate_binstubs
require "rubygems/commands/pristine_command" require_relative "pristine_command"
say "Regenerating binstubs" say "Regenerating binstubs"
args = %w[--all --only-executables --silent] args = %w[--all --only-executables --silent]

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/gemcutter_utilities' require_relative '../gemcutter_utilities'
class Gem::Commands::SigninCommand < Gem::Command class Gem::Commands::SigninCommand < Gem::Command
include Gem::GemcutterUtilities include Gem::GemcutterUtilities

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
class Gem::Commands::SignoutCommand < Gem::Command class Gem::Commands::SignoutCommand < Gem::Command
def initialize def initialize

Просмотреть файл

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/remote_fetcher' require_relative '../remote_fetcher'
require 'rubygems/spec_fetcher' require_relative '../spec_fetcher'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
class Gem::Commands::SourcesCommand < Gem::Command class Gem::Commands::SourcesCommand < Gem::Command
include Gem::LocalRemoteOptions include Gem::LocalRemoteOptions

Просмотреть файл

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
require 'rubygems/version_option' require_relative '../version_option'
require 'rubygems/package' require_relative '../package'
class Gem::Commands::SpecificationCommand < Gem::Command class Gem::Commands::SpecificationCommand < Gem::Command
include Gem::LocalRemoteOptions include Gem::LocalRemoteOptions

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
class Gem::Commands::StaleCommand < Gem::Command class Gem::Commands::StaleCommand < Gem::Command
def initialize def initialize

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/version_option' require_relative '../version_option'
require 'rubygems/uninstaller' require_relative '../uninstaller'
require 'fileutils' require 'fileutils'
## ##

Просмотреть файл

@ -1,9 +1,9 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/version_option' require_relative '../version_option'
require 'rubygems/security_option' require_relative '../security_option'
require 'rubygems/remote_fetcher' require_relative '../remote_fetcher'
require 'rubygems/package' require_relative '../package'
# forward-declare # forward-declare

Просмотреть файл

@ -1,13 +1,13 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/command_manager' require_relative '../command_manager'
require 'rubygems/dependency_installer' require_relative '../dependency_installer'
require 'rubygems/install_update_options' require_relative '../install_update_options'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
require 'rubygems/spec_fetcher' require_relative '../spec_fetcher'
require 'rubygems/version_option' require_relative '../version_option'
require 'rubygems/install_message' # must come before rdoc for messaging require_relative '../install_message' # must come before rdoc for messaging
require 'rubygems/rdoc' require_relative '../rdoc'
class Gem::Commands::UpdateCommand < Gem::Command class Gem::Commands::UpdateCommand < Gem::Command
include Gem::InstallUpdateOptions include Gem::InstallUpdateOptions

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
class Gem::Commands::WhichCommand < Gem::Command class Gem::Commands::WhichCommand < Gem::Command
def initialize def initialize

Просмотреть файл

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/command' require_relative '../command'
require 'rubygems/local_remote_options' require_relative '../local_remote_options'
require 'rubygems/version_option' require_relative '../version_option'
require 'rubygems/gemcutter_utilities' require_relative '../gemcutter_utilities'
class Gem::Commands::YankCommand < Gem::Command class Gem::Commands::YankCommand < Gem::Command
include Gem::LocalRemoteOptions include Gem::LocalRemoteOptions

Просмотреть файл

@ -5,7 +5,7 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems/user_interaction' require_relative 'user_interaction'
require 'rbconfig' require 'rbconfig'
## ##

Просмотреть файл

@ -1,12 +1,12 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems' require_relative '../rubygems'
require 'rubygems/dependency_list' require_relative 'dependency_list'
require 'rubygems/package' require_relative 'package'
require 'rubygems/installer' require_relative 'installer'
require 'rubygems/spec_fetcher' require_relative 'spec_fetcher'
require 'rubygems/user_interaction' require_relative 'user_interaction'
require 'rubygems/available_set' require_relative 'available_set'
require 'rubygems/deprecate' require_relative 'deprecate'
## ##
# Installs a gem along with all its dependencies from local and remote gems. # Installs a gem along with all its dependencies from local and remote gems.

Просмотреть файл

@ -6,7 +6,7 @@
#++ #++
require 'tsort' require 'tsort'
require 'rubygems/deprecate' require_relative 'deprecate'
## ##
# Gem::DependencyList is used for installing and uninstalling gems in the # Gem::DependencyList is used for installing and uninstalling gems in the

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems' require_relative '../rubygems'
require 'rubygems/user_interaction' require_relative 'user_interaction'
## ##
# Cleans up after a partially-failed uninstall or for an invalid # Cleans up after a partially-failed uninstall or for an invalid

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/deprecate' require_relative 'deprecate'
require 'rubygems/unknown_command_spell_checker' require_relative 'unknown_command_spell_checker'
## ##
# Base exception class for RubyGems. All exception raised by RubyGems are a # Base exception class for RubyGems. All exception raised by RubyGems are a

Просмотреть файл

@ -5,9 +5,9 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems' require_relative '../rubygems'
require 'rubygems/command_manager' require_relative 'command_manager'
require 'rubygems/deprecate' require_relative 'deprecate'
## ##
# Load additional plugins from $LOAD_PATH # Load additional plugins from $LOAD_PATH

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/remote_fetcher' require_relative 'remote_fetcher'
require 'rubygems/text' require_relative 'text'
## ##
# Utility methods for using the RubyGems API. # Utility methods for using the RubyGems API.

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems' require_relative '../rubygems'
require 'rubygems/package' require_relative 'package'
require 'tmpdir' require 'tmpdir'
## ##

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems' require_relative '../rubygems'
require 'rubygems/user_interaction' require_relative 'user_interaction'
## ##
# A post-install hook that displays "Successfully installed # A post-install hook that displays "Successfully installed

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems' require_relative '../rubygems'
require 'rubygems/user_interaction' require_relative 'user_interaction'
## ##
# A default post-install hook that displays "Successfully installed # A default post-install hook that displays "Successfully installed

Просмотреть файл

@ -5,8 +5,8 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems' require_relative '../rubygems'
require 'rubygems/security_option' require_relative 'security_option'
## ##
# Mixin methods for install and update options for Gem::Commands # Mixin methods for install and update options for Gem::Commands

Просмотреть файл

@ -5,13 +5,13 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems/command' require_relative 'command'
require 'rubygems/installer_uninstaller_utils' require_relative 'installer_uninstaller_utils'
require 'rubygems/exceptions' require_relative 'exceptions'
require 'rubygems/deprecate' require_relative 'deprecate'
require 'rubygems/package' require_relative 'package'
require 'rubygems/ext' require_relative 'ext'
require 'rubygems/user_interaction' require_relative 'user_interaction'
## ##
# The installer installs the files contained in the .gem into the Gem.home. # The installer installs the files contained in the .gem into the Gem.home.

Просмотреть файл

@ -6,7 +6,7 @@
#++ #++
require 'uri' require 'uri'
require 'rubygems' require_relative '../rubygems'
## ##
# Mixin methods for local and remote Gem::Command options. # Mixin methods for local and remote Gem::Command options.

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/user_interaction' require_relative 'user_interaction'
## ##
# This Gem::StreamUI subclass records input and output to StringIO for # This Gem::StreamUI subclass records input and output to StringIO for

Просмотреть файл

@ -41,9 +41,9 @@
# #files are the files in the .gem tar file, not the Ruby files in the gem # #files are the files in the .gem tar file, not the Ruby files in the gem
# #extract_files and #contents automatically call #verify # #extract_files and #contents automatically call #verify
require "rubygems" require_relative "../rubygems"
require 'rubygems/security' require_relative 'security'
require 'rubygems/user_interaction' require_relative 'user_interaction'
class Gem::Package class Gem::Package
include Gem::UserInteraction include Gem::UserInteraction
@ -702,12 +702,12 @@ EOM
end end
end end
require 'rubygems/package/digest_io' require_relative 'package/digest_io'
require 'rubygems/package/source' require_relative 'package/source'
require 'rubygems/package/file_source' require_relative 'package/file_source'
require 'rubygems/package/io_source' require_relative 'package/io_source'
require 'rubygems/package/old' require_relative 'package/old'
require 'rubygems/package/tar_header' require_relative 'package/tar_header'
require 'rubygems/package/tar_reader' require_relative 'package/tar_reader'
require 'rubygems/package/tar_reader/entry' require_relative 'package/tar_reader/entry'
require 'rubygems/package/tar_writer' require_relative 'package/tar_writer'

Просмотреть файл

@ -121,4 +121,4 @@ class Gem::Package::TarReader
end end
end end
require 'rubygems/package/tar_reader/entry' require_relative 'tar_reader/entry'

Просмотреть файл

@ -20,8 +20,8 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
require 'rubygems' require_relative '../rubygems'
require 'rubygems/package' require_relative 'package'
require 'rake/packagetask' require 'rake/packagetask'
## ##

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rubygems/deprecate" require_relative "deprecate"
## ##
# Available list of platforms for targeting Gem installations. # Available list of platforms for targeting Gem installations.

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems' require_relative '../rubygems'
begin begin
require 'rdoc/rubygems_hook' require 'rdoc/rubygems_hook'

Просмотреть файл

@ -1,11 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems' require_relative '../rubygems'
require 'rubygems/request' require_relative 'request'
require 'rubygems/request/connection_pools' require_relative 'request/connection_pools'
require 'rubygems/s3_uri_signer' require_relative 's3_uri_signer'
require 'rubygems/uri_formatter' require_relative 'uri_formatter'
require 'rubygems/uri_parser' require_relative 'uri_parser'
require 'rubygems/user_interaction' require_relative 'user_interaction'
## ##
# RemoteFetcher handles the details of fetching gems and gem information from # RemoteFetcher handles the details of fetching gems and gem information from

Просмотреть файл

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'net/http' require 'net/http'
require 'rubygems/user_interaction' require_relative 'user_interaction'
class Gem::Request class Gem::Request
extend Gem::UserInteraction extend Gem::UserInteraction
@ -287,6 +287,6 @@ class Gem::Request
end end
end end
require 'rubygems/request/http_pool' require_relative 'request/http_pool'
require 'rubygems/request/https_pool' require_relative 'request/https_pool'
require 'rubygems/request/connection_pools' require_relative 'request/connection_pools'

Просмотреть файл

@ -303,7 +303,7 @@ class Gem::RequestSet
end end
end end
require "rubygems/dependency_installer" require_relative "dependency_installer"
inst = Gem::DependencyInstaller.new options inst = Gem::DependencyInstaller.new options
inst.installed_gems.replace specs inst.installed_gems.replace specs
@ -461,6 +461,6 @@ class Gem::RequestSet
end end
end end
require 'rubygems/request_set/gem_dependency_api' require_relative 'request_set/gem_dependency_api'
require 'rubygems/request_set/lockfile' require_relative 'request_set/lockfile'
require 'rubygems/request_set/lockfile/tokenizer' require_relative 'request_set/lockfile/tokenizer'

Просмотреть файл

@ -236,4 +236,4 @@ class Gem::RequestSet::Lockfile
end end
end end
require 'rubygems/request_set/lockfile/tokenizer' require_relative 'lockfile/tokenizer'

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/request_set/lockfile/parser' require_relative 'parser'
class Gem::RequestSet::Lockfile::Tokenizer class Gem::RequestSet::Lockfile::Tokenizer
Token = Struct.new :type, :value, :column, :line Token = Struct.new :type, :value, :column, :line

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rubygems/deprecate" require_relative "deprecate"
## ##
# A Requirement is a set of one or more version restrictions. It supports a # A Requirement is a set of one or more version restrictions. It supports a

Просмотреть файл

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/dependency' require_relative 'dependency'
require 'rubygems/exceptions' require_relative 'exceptions'
require 'rubygems/util/list' require_relative 'util/list'
## ##
# Given a set of Gem::Dependency objects as +needed+ and a way to query the # 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. # all the requirements.
class Gem::Resolver class Gem::Resolver
require 'rubygems/resolver/molinillo' require_relative 'resolver/molinillo'
## ##
# If the DEBUG_RESOLVER environment variable is set then debugging mode is # If the DEBUG_RESOLVER environment variable is set then debugging mode is
@ -318,30 +318,30 @@ class Gem::Resolver
private :amount_constrained private :amount_constrained
end end
require 'rubygems/resolver/activation_request' require_relative 'resolver/activation_request'
require 'rubygems/resolver/conflict' require_relative 'resolver/conflict'
require 'rubygems/resolver/dependency_request' require_relative 'resolver/dependency_request'
require 'rubygems/resolver/requirement_list' require_relative 'resolver/requirement_list'
require 'rubygems/resolver/stats' require_relative 'resolver/stats'
require 'rubygems/resolver/set' require_relative 'resolver/set'
require 'rubygems/resolver/api_set' require_relative 'resolver/api_set'
require 'rubygems/resolver/composed_set' require_relative 'resolver/composed_set'
require 'rubygems/resolver/best_set' require_relative 'resolver/best_set'
require 'rubygems/resolver/current_set' require_relative 'resolver/current_set'
require 'rubygems/resolver/git_set' require_relative 'resolver/git_set'
require 'rubygems/resolver/index_set' require_relative 'resolver/index_set'
require 'rubygems/resolver/installer_set' require_relative 'resolver/installer_set'
require 'rubygems/resolver/lock_set' require_relative 'resolver/lock_set'
require 'rubygems/resolver/vendor_set' require_relative 'resolver/vendor_set'
require 'rubygems/resolver/source_set' require_relative 'resolver/source_set'
require 'rubygems/resolver/specification' require_relative 'resolver/specification'
require 'rubygems/resolver/spec_specification' require_relative 'resolver/spec_specification'
require 'rubygems/resolver/api_specification' require_relative 'resolver/api_specification'
require 'rubygems/resolver/git_specification' require_relative 'resolver/git_specification'
require 'rubygems/resolver/index_specification' require_relative 'resolver/index_specification'
require 'rubygems/resolver/installed_specification' require_relative 'resolver/installed_specification'
require 'rubygems/resolver/local_specification' require_relative 'resolver/local_specification'
require 'rubygems/resolver/lock_specification' require_relative 'resolver/lock_specification'
require 'rubygems/resolver/vendor_specification' require_relative 'resolver/vendor_specification'

Просмотреть файл

@ -21,7 +21,7 @@ class Gem::Resolver::GitSpecification < Gem::Resolver::SpecSpecification
# the executables. # the executables.
def install(options = {}) def install(options = {})
require 'rubygems/installer' require_relative '../installer'
installer = Gem::Installer.for_spec spec, options installer = Gem::Installer.for_spec spec, options

Просмотреть файл

@ -1,2 +1,2 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/resolver/molinillo/lib/molinillo' require_relative 'molinillo/lib/molinillo'

Просмотреть файл

@ -93,7 +93,7 @@ class Gem::Resolver::Specification
# specification. # specification.
def install(options = {}) def install(options = {})
require 'rubygems/installer' require_relative '../installer'
gem = download options gem = download options

Просмотреть файл

@ -5,7 +5,7 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems/exceptions' require_relative 'exceptions'
require_relative 'openssl' require_relative 'openssl'
## ##
@ -592,9 +592,9 @@ module Gem::Security
end end
if Gem::HAVE_OPENSSL if Gem::HAVE_OPENSSL
require 'rubygems/security/policy' require_relative 'security/policy'
require 'rubygems/security/policies' require_relative 'security/policies'
require 'rubygems/security/trust_dir' require_relative 'security/trust_dir'
end end
require 'rubygems/security/signer' require_relative 'security/signer'

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/user_interaction' require_relative '../user_interaction'
## ##
# A Gem::Security::Policy object encapsulates the settings for verifying # A Gem::Security::Policy object encapsulates the settings for verifying

Просмотреть файл

@ -2,7 +2,7 @@
## ##
# Basic OpenSSL-based package signing class. # Basic OpenSSL-based package signing class.
require "rubygems/user_interaction" require_relative "../user_interaction"
class Gem::Security::Signer class Gem::Security::Signer
include Gem::UserInteraction include Gem::UserInteraction

Просмотреть файл

@ -5,7 +5,7 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems' require_relative '../rubygems'
# forward-declare # forward-declare
@ -20,7 +20,7 @@ end
module Gem::SecurityOption module Gem::SecurityOption
def add_security_option def add_security_option
OptionParser.accept Gem::Security::Policy do |value| OptionParser.accept Gem::Security::Policy do |value|
require 'rubygems/security' require_relative 'security'
raise OptionParser::InvalidArgument, 'OpenSSL not installed' unless raise OptionParser::InvalidArgument, 'OpenSSL not installed' unless
defined?(Gem::Security::HighSecurity) defined?(Gem::Security::HighSecurity)

Просмотреть файл

@ -3,8 +3,8 @@ require 'zlib'
require 'erb' require 'erb'
require 'uri' require 'uri'
require 'rubygems' require_relative '../rubygems'
require 'rubygems/rdoc' require_relative 'rdoc'
## ##
# Gem::Server and allows users to serve gems for consumption by # Gem::Server and allows users to serve gems for consumption by

Просмотреть файл

@ -240,9 +240,9 @@ class Gem::Source
end end
end end
require 'rubygems/source/git' require_relative 'source/git'
require 'rubygems/source/installed' require_relative 'source/installed'
require 'rubygems/source/specific_file' require_relative 'source/specific_file'
require 'rubygems/source/local' require_relative 'source/local'
require 'rubygems/source/lock' require_relative 'source/lock'
require 'rubygems/source/vendor' require_relative 'source/vendor'

Просмотреть файл

@ -1,9 +1,9 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/remote_fetcher' require_relative 'remote_fetcher'
require 'rubygems/user_interaction' require_relative 'user_interaction'
require 'rubygems/errors' require_relative 'errors'
require 'rubygems/text' require_relative 'text'
require 'rubygems/name_tuple' require_relative 'name_tuple'
## ##
# SpecFetcher handles metadata updates from remote gem repositories. # SpecFetcher handles metadata updates from remote gem repositories.

Просмотреть файл

@ -6,11 +6,11 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems/deprecate' require_relative 'deprecate'
require 'rubygems/basic_specification' require_relative 'basic_specification'
require 'rubygems/stub_specification' require_relative 'stub_specification'
require 'rubygems/specification_policy' require_relative 'specification_policy'
require 'rubygems/util/list' require_relative 'util/list'
## ##
# The Specification class contains the information for a gem. Typically # 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 unresolved_deps = Gem::Specification.unresolved_deps.dup
Gem::Specification.unresolved_deps.clear Gem::Specification.unresolved_deps.clear
require 'rubygems/config_file' require_relative 'config_file'
require 'rubygems/ext' require_relative 'ext'
require 'rubygems/user_interaction' require_relative 'user_interaction'
ui = Gem::SilentUI.new ui = Gem::SilentUI.new
Gem::DefaultUserInteraction.use_ui ui do 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 # back, we have to check again here to make sure that our
# psych code was properly loaded, and load it if not. # psych code was properly loaded, and load it if not.
unless Gem.const_defined?(:NoAliasYAMLTree) unless Gem.const_defined?(:NoAliasYAMLTree)
require 'rubygems/psych_tree' require_relative 'psych_tree'
end end
builder = Gem::NoAliasYAMLTree.create builder = Gem::NoAliasYAMLTree.create

Просмотреть файл

@ -1,4 +1,4 @@
require 'rubygems/user_interaction' require_relative 'user_interaction'
class Gem::SpecificationPolicy class Gem::SpecificationPolicy
include Gem::UserInteraction include Gem::UserInteraction

Просмотреть файл

@ -6,11 +6,11 @@
#++ #++
require 'fileutils' require 'fileutils'
require 'rubygems' require_relative '../rubygems'
require 'rubygems/installer_uninstaller_utils' require_relative 'installer_uninstaller_utils'
require 'rubygems/dependency_list' require_relative 'dependency_list'
require 'rubygems/rdoc' require_relative 'rdoc'
require 'rubygems/user_interaction' require_relative 'user_interaction'
## ##
# An Uninstaller. # An Uninstaller.
@ -360,7 +360,7 @@ class Gem::Uninstaller
# of what it did for us to find rather than trying to recreate # of what it did for us to find rather than trying to recreate
# it again. # it again.
if @format_executable if @format_executable
require 'rubygems/installer' require_relative 'installer'
Gem::Installer.exec_format % File.basename(filename) Gem::Installer.exec_format % File.basename(filename)
else else
filename filename

Просмотреть файл

@ -5,8 +5,8 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems/deprecate' require_relative 'deprecate'
require 'rubygems/text' require_relative 'text'
## ##
# Module that defines the default UserInteraction. Any class including this # Module that defines the default UserInteraction. Any class including this

Просмотреть файл

@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'rubygems/text' require_relative '../text'
class Gem::Licenses class Gem::Licenses
extend Gem::Text extend Gem::Text

Просмотреть файл

@ -5,8 +5,8 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems/package' require_relative 'package'
require 'rubygems/installer' require_relative 'installer'
## ##
# Validator performs various gem file and gem database validation # Validator performs various gem file and gem database validation

Просмотреть файл

@ -5,7 +5,7 @@
# See LICENSE.txt for permissions. # See LICENSE.txt for permissions.
#++ #++
require 'rubygems' require_relative '../rubygems'
## ##
# Mixin methods for --version and --platform Gem::Command options. # Mixin methods for --version and --platform Gem::Command options.