diff options
-rw-r--r-- | lib/rubygems.rb | 156 |
1 files changed, 51 insertions, 105 deletions
@@ -9,7 +9,7 @@ require 'rbconfig' module Gem - VERSION = "3.1.2".freeze end # Must be first since it unloads the prelude from 1.9.2 @@ -26,27 +26,27 @@ require 'rubygems/errors' # For user documentation, see: # # * <tt>gem help</tt> and <tt>gem help [command]</tt> -# * {RubyGems User Guide}[http://guides.rubygems.org/] -# * {Frequently Asked Questions}[http://guides.rubygems.org/faqs] # # For gem developer documentation see: # -# * {Creating Gems}[http://guides.rubygems.org/make-your-own-gem] # * Gem::Specification # * Gem::Version for version dependency notes # # Further RubyGems documentation can be found at: # -# * {RubyGems Guides}[http://guides.rubygems.org] -# * {RubyGems API}[http://www.rubydoc.info//rubygems/rubygems] (also available from # <tt>gem server</tt>) # # == RubyGems Plugins # -# As of RubyGems 1.3.2, RubyGems will load plugins installed in gems or # $LOAD_PATH. Plugins must be named 'rubygems_plugin' (.rb, .so, etc) and -# placed at the root of your gem's #require_path. Plugins are discovered via -# Gem::find_files and then loaded. # # For an example plugin, see the {Graph gem}[https://.com/seattlerb/graph] # which adds a `gem graph` command. @@ -148,6 +148,7 @@ module Gem doc extensions gems specifications ].freeze @@ -409,8 +410,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} ## # The path where gems are to be installed. - #-- - # FIXME deprecate these once everything else has been done -ebh def self.dir paths.home @@ -424,6 +423,10 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} paths.spec_cache_dir end ## # Quietly ensure the Gem directory +dir+ contains all the proper # subdirectories. If we can't create a directory due to a permission @@ -573,50 +576,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} private_class_method :find_home - # TODO: remove in RubyGems 4.0 - - ## - # Zlib::GzipReader wrapper that unzips +data+. - - def self.gunzip(data) - Gem::Util.gunzip data - end - - class << self - - extend Gem::Deprecate - deprecate :gunzip, "Gem::Util.gunzip", 2018, 12 - - end - - ## - # Zlib::GzipWriter wrapper that zips +data+. - - def self.gzip(data) - Gem::Util.gzip data - end - - class << self - - extend Gem::Deprecate - deprecate :gzip, "Gem::Util.gzip", 2018, 12 - - end - - ## - # A Zlib::Inflate#inflate wrapper - - def self.inflate(data) - Gem::Util.inflate data - end - - class << self - - extend Gem::Deprecate - deprecate :inflate, "Gem::Util.inflate", 2018, 12 - - end - ## # Top level install helper method. Allows you to install gems interactively: # @@ -1018,11 +977,28 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} @suffix_pattern ||= "{#{suffixes.join(',')}}" end def self.suffix_regexp @suffix_regexp ||= /#{Regexp.union(suffixes)}\z/ end ## # Suffixes for require-able paths. def self.suffixes @@ -1120,35 +1096,17 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} end ## - # Find the 'rubygems_plugin' files in the latest installed gems and load - # them def self.load_plugins - # Remove this env var by at least 3.0 - if ENV['RUBYGEMS_LOAD_ALL_PLUGINS'] - load_plugin_files find_files('rubygems_plugin', false) - else - load_plugin_files find_latest_files('rubygems_plugin', false) - end end ## # Find all 'rubygems_plugin' files in $LOAD_PATH and load them def self.load_env_plugins - path = "rubygems_plugin" - - files = [] - glob = "#{path}#{Gem.suffix_pattern}" - $LOAD_PATH.each do |load_path| - globbed = Gem::Util.glob_files_in_dir(glob, load_path) - - globbed.each do |load_path_file| - files << load_path_file if File.file?(load_path_file.tap(&Gem::UNTAINT)) - end - end - - load_plugin_files files end ## @@ -1223,18 +1181,6 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} end end - class << self - - ## - # TODO remove with RubyGems 4.0 - - alias detect_gemdeps use_gemdeps # :nodoc: - - extend Gem::Deprecate - deprecate :detect_gemdeps, "Gem.use_gemdeps", 2018, 12 - - end - ## # The SOURCE_DATE_EPOCH environment variable (or, if that's not set, the current time), converted to Time object. # This is used throughout RubyGems for enabling reproducible builds. @@ -1366,23 +1312,23 @@ An Array (#{env.inspect}) was passed in from #{caller[3]} MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/".freeze - autoload :BundlerVersionFinder, 'rubygems/bundler_version_finder' - autoload :ConfigFile, 'rubygems/config_file' - autoload :Dependency, 'rubygems/dependency' - autoload :DependencyList, 'rubygems/dependency_list' - autoload :Installer, 'rubygems/installer' - autoload :Licenses, 'rubygems/util/licenses' - autoload :PathSupport, 'rubygems/path_support' - autoload :Platform, 'rubygems/platform' - autoload :RequestSet, 'rubygems/request_set' - autoload :Requirement, 'rubygems/requirement' - autoload :Resolver, 'rubygems/resolver' - autoload :Source, 'rubygems/source' - autoload :SourceList, 'rubygems/source_list' - autoload :SpecFetcher, 'rubygems/spec_fetcher' - autoload :Specification, 'rubygems/specification' - autoload :Util, 'rubygems/util' - autoload :Version, 'rubygems/version' require "rubygems/specification" end |