summaryrefslogtreecommitdiff
path: root/lib/rubygems
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-18 01:39:13 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-18 01:39:13 +0000
commitc6da9cadb346cc1d250c7ed6d8fd33c62a11030e ()
tree83bea4d75a82b41f265b884a6fb4ffe418b41f94 /lib/rubygems
parentecedebab2c559386c86f98be364c0e6941c2a405 (diff)
Merge RubyGems 2.7.7
see release details here: https://blog.rubygems.org/2018/05/18/2.7.7-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/rubygems/bundler_version_finder.rb6
-rw-r--r--lib/rubygems/commands/push_command.rb2
-rw-r--r--lib/rubygems/commands/setup_command.rb2
-rw-r--r--lib/rubygems/commands/unpack_command.rb2
-rw-r--r--lib/rubygems/dependency.rb1
-rw-r--r--lib/rubygems/dependency_installer.rb6
-rw-r--r--lib/rubygems/exceptions.rb6
-rw-r--r--lib/rubygems/indexer.rb2
-rw-r--r--lib/rubygems/installer.rb6
-rw-r--r--lib/rubygems/package.rb12
-rw-r--r--lib/rubygems/remote_fetcher.rb2
-rw-r--r--lib/rubygems/request_set.rb4
-rw-r--r--lib/rubygems/server.rb6
-rw-r--r--lib/rubygems/source.rb2
-rw-r--r--lib/rubygems/specification.rb17
-rw-r--r--lib/rubygems/test_case.rb10
-rw-r--r--lib/rubygems/test_utilities.rb2
-rw-r--r--lib/rubygems/user_interaction.rb4
-rw-r--r--lib/rubygems/version.rb1
19 files changed, 63 insertions, 30 deletions
@@ -1,3 +1,7 @@
module Gem::BundlerVersionFinder
@without_filtering = false
@@ -102,7 +106,7 @@ To install the missing version, run `gem install bundler:#{vr.first}`
lockfile = case gemfile
when "gems.rb" then "gems.locked"
else "#{gemfile}.lock"
- end.untaint
return unless File.file?(lockfile)
@@ -13,7 +13,7 @@ class Gem::Commands::PushCommand < Gem::Command
The push command uploads a gem to the push server (the default is
https://rubygems.org) and adds it to the index.
-The gem can be removed from the index (but only the index) using the yank
command. For further discussion see the help for the yank command.
EOF
end
@@ -385,7 +385,7 @@ By default, this RubyGems will install gem as:
each {|default_gem| rm_r File.join(bundler_spec.gems_dir, default_gem) }
end
- bundler_bin_dir = File.join(Gem.default_dir, 'gems', bundler_spec.full_name, bundler_spec.bindir)
bundler_bin_dir = File.join(options[:destdir], bundler_bin_dir) unless Gem.win_platform?
mkdir_p bundler_bin_dir
bundler_spec.executables.each do |e|
@@ -183,7 +183,7 @@ command help for an example.
when 'metadata' then
metadata = entry.read
when 'metadata.gz' then
- metadata = Gem.gunzip entry.read
end
end
end
@@ -2,6 +2,7 @@
##
# The Dependency class holds a Gem name and a Gem::Requirement.
require "rubygems/requirement"
class Gem::Dependency
@@ -113,7 +113,7 @@ class Gem::DependencyInstaller
##
#--
- # TODO remove, no longer used
def add_found_dependencies to_do, dependency_list # :nodoc:
seen = {}
@@ -163,6 +163,7 @@ class Gem::DependencyInstaller
dependency_list.remove_specs_unsatisfied_by dependencies
end
##
# Creates an AvailableSet to install from based on +dep_or_name+ and
@@ -321,7 +322,7 @@ class Gem::DependencyInstaller
# Gathers all dependencies necessary for the installation from local and
# remote sources unless the ignore_dependencies was given.
#--
- # TODO remove at RubyGems 3
def gather_dependencies # :nodoc:
specs = @available.all_specs
@@ -354,6 +355,7 @@ class Gem::DependencyInstaller
@gems_to_install = dependency_list.dependency_order.reverse
end
def in_background what # :nodoc:
fork_happened = false
@@ -4,6 +4,8 @@
# Each exception needs a brief description and the scenarios where it is
# likely to be raised
##
# Base exception class for RubyGems. All exception raised by RubyGems are a
# subclass of this one.
@@ -11,10 +13,12 @@ class Gem::Exception < RuntimeError
##
#--
- # TODO: remove in RubyGems 3, nobody sets this
attr_accessor :source_exception # :nodoc:
end
class Gem::CommandLineError < Gem::Exception; end
@@ -347,7 +347,7 @@ class Gem::Indexer
data = Gem.read_binary path
compressed_data = Gem.read_binary "#{path}.#{extension}"
- unless data == Gem.inflate(compressed_data) then
raise "Compressed file #{compressed_path} does not match uncompressed file #{path}"
end
end
@@ -7,6 +7,7 @@
require 'rubygems/command'
require 'rubygems/exceptions'
require 'rubygems/package'
require 'rubygems/ext'
require 'rubygems/user_interaction'
@@ -27,6 +28,8 @@ require 'fileutils'
class Gem::Installer
##
# Paths where env(1) might live. Some systems are broken and have it in
# /bin
@@ -777,13 +780,14 @@ TEXT
##
# Logs the build +output+ in +build_dir+, then raises Gem::Ext::BuildError.
#
- # TODO: Delete this for RubyGems 3. It remains for API compatibility
def extension_build_error(build_dir, output, backtrace = nil) # :nodoc:
builder = Gem::Ext::Builder.new spec, @build_args
builder.build_error build_dir, output, backtrace
end
##
# Reads the file index and extracts each file into the gem directory.
@@ -429,6 +429,14 @@ EOM
destination
end
def mkdir_p_safe mkdir, mkdir_options, destination_dir, file_name
destination_dir = realpath File.expand_path(destination_dir)
parts = mkdir.split(File::SEPARATOR)
@@ -437,7 +445,7 @@ EOM
path = File.expand_path(path + File::SEPARATOR + basename)
lstat = File.lstat path rescue nil
if !lstat || !lstat.directory?
- unless path.start_with? destination_dir and (FileUtils.mkdir path, mkdir_options rescue false)
raise Gem::Package::PathError.new(file_name, destination_dir)
end
end
@@ -591,7 +599,7 @@ EOM
end
case file_name
- when /^metadata(.gz)?$/ then
load_spec entry
when 'data.tar.gz' then
verify_gz entry
@@ -293,7 +293,7 @@ class Gem::RemoteFetcher
if data and !head and uri.to_s =~ /\.gz$/
begin
- data = Gem.gunzip data
rescue Zlib::GzipFile::Error
raise FetchError.new("server did not return a valid file", uri.to_s)
end
@@ -171,7 +171,9 @@ class Gem::RequestSet
rescue Gem::RuntimeRequirementNotMetError => e
recent_match = req.spec.set.find_all(req.request).sort_by(&:version).reverse_each.find do |s|
s = s.spec
- s.required_ruby_version.satisfied_by?(Gem.ruby_version) && s.required_rubygems_version.satisfied_by?(Gem.rubygems_version)
end
if recent_match
suggestion = "The last version of #{req.request} to support your Ruby & RubyGems was #{recent_match.version}. Try installing it with `gem install #{recent_match.name} -v #{recent_match.version}`"
@@ -492,7 +492,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
specs = Marshal.dump specs
if req.path =~ /\.gz$/ then
- specs = Gem.gzip specs
res['content-type'] = 'application/x-gzip'
else
res['content-type'] = 'application/octet-stream'
@@ -553,7 +553,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
specs = Marshal.dump specs
if req.path =~ /\.gz$/ then
- specs = Gem.gzip specs
res['content-type'] = 'application/x-gzip'
else
res['content-type'] = 'application/octet-stream'
@@ -852,7 +852,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
specs = Marshal.dump specs
if req.path =~ /\.gz$/ then
- specs = Gem.gzip specs
res['content-type'] = 'application/x-gzip'
else
res['content-type'] = 'application/octet-stream'
@@ -155,7 +155,7 @@ class Gem::Source
uri.path << '.rz'
spec = fetcher.fetch_path uri
- spec = Gem.inflate spec
if update_cache? then
FileUtils.mkdir_p cache_dir
@@ -40,6 +40,8 @@ require 'uri'
class Gem::Specification < Gem::BasicSpecification
# REFACTOR: Consider breaking out this version stuff into a separate
# module. There's enough special stuff around it that it may justify
# a separate class.
@@ -715,6 +717,7 @@ class Gem::Specification < Gem::BasicSpecification
# Deprecated: You must now specify the executable name to Gem.bin_path.
attr_writer :default_executable
##
# Allows deinstallation of gems with legacy platforms.
@@ -1810,6 +1813,7 @@ class Gem::Specification < Gem::BasicSpecification
end
result
end
##
# The default value for specification attribute +name+
@@ -2018,6 +2022,7 @@ class Gem::Specification < Gem::BasicSpecification
def has_rdoc # :nodoc:
true
end
##
# Deprecated and ignored.
@@ -2027,8 +2032,10 @@ class Gem::Specification < Gem::BasicSpecification
def has_rdoc= ignored # :nodoc:
@has_rdoc = true
end
alias :has_rdoc? :has_rdoc # :nodoc:
##
# True if this gem has files in test_files
@@ -3074,16 +3081,6 @@ open-ended dependency on #{dep} is not recommended
@require_paths
end
- extend Gem::Deprecate
-
- # TODO:
- # deprecate :has_rdoc, :none, 2011, 10
- # deprecate :has_rdoc?, :none, 2011, 10
- # deprecate :has_rdoc=, :none, 2011, 10
- # deprecate :default_executable, :none, 2011, 10
- # deprecate :default_executable=, :none, 2011, 10
- # deprecate :file_name, :cache_file, 2011, 10
- # deprecate :full_gem_path, :cache_file, 2011, 10
end
# DOC: What is this and why is it here, randomly, at the end of this file?
@@ -88,6 +88,8 @@ end
class Gem::TestCase < MiniTest::Unit::TestCase
attr_accessor :fetcher # :nodoc:
attr_accessor :gem_repo # :nodoc:
@@ -672,11 +674,13 @@ class Gem::TestCase < MiniTest::Unit::TestCase
end
##
- # TODO: remove in RubyGems 3.0
def quick_spec name, version = '2' # :nodoc:
util_spec name, version
end
##
# Builds a gem from +spec+ and places it in <tt>File.join @gemhome,
@@ -774,7 +778,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase
##
# new_spec is deprecated as it is never used.
#
- # TODO: remove in RubyGems 3.0
def new_spec name, version, deps = nil, *files # :nodoc:
require 'rubygems/specification'
@@ -815,6 +819,8 @@ class Gem::TestCase < MiniTest::Unit::TestCase
spec
end
def new_default_spec(name, version, deps = nil, *files)
spec = util_spec name, version, deps
@@ -64,7 +64,7 @@ class Gem::FakeFetcher
data.call
else
if path.to_s =~ /gz$/ and not data.nil? and not data.empty? then
- data = Gem.gunzip data
end
data
@@ -6,6 +6,7 @@
#++
require 'rubygems/util'
##
# Module that defines the default UserInteraction. Any class including this
@@ -170,6 +171,8 @@ end
class Gem::StreamUI
##
# The input stream
@@ -384,6 +387,7 @@ class Gem::StreamUI
def debug(statement)
@errs.puts statement
end
##
# Terminate the application with exit code +status+, running any exit
@@ -170,6 +170,7 @@ class Gem::Version
# True if the +version+ string matches RubyGems' requirements.
def self.correct? version
!!(version.to_s =~ ANCHORED_VERSION_PATTERN)
end