summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-11 15:03:57 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2019-11-11 16:59:49 +0900
commit7d463e360b9c4718b17378eb52783116a01b884b (patch)
treeee6951d298d76fcbf0c5e062712e54de56a3fa39 /lib/rubygems.rb
parent31416423809f64d4b5ea6b9651cced3179cc5ced (diff)
Merge RubyGems 3.1.0.pre3
* Fix gem pristine not accounting for user installed gems. Pull request #2914 by Luis Sagastume. * Refactor keyword argument test for Ruby 2.7. Pull request #2947 by SHIBATA Hiroshi. * Fix errors at frozen Gem::Version. Pull request #2949 by Nobuyoshi Nakada. * Remove taint usage on Ruby 2.7+. Pull request #2951 by Jeremy Evans. * Check Manifest.txt is up to date. Pull request #2953 by David Rodríguez. * Clarify symlink conditionals in tests. Pull request #2962 by David Rodríguez. * Update command line parsing to work under ps. Pull request #2966 by David Rodríguez. * Properly test `Gem::Specifications.stub_for`. Pull request #2970 by David Rodríguez. * Fix Gem::LOADED_SPECS_MUTEX handling for recursive locking. Pull request #2985 by MSP-Greg.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2666
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 44b9a2e..8883936 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -9,7 +9,7 @@
require 'rbconfig'
module Gem
- VERSION = "3.1.0.pre2".freeze
+ VERSION = "3.1.0.pre3".freeze
end
# Must be first since it unloads the prelude from 1.9.2
@@ -116,6 +116,11 @@ require 'rubygems/path_support'
module Gem
RUBYGEMS_DIR = File.dirname File.expand_path(__FILE__)
+ # Taint support is deprecated in Ruby 2.7.
+ # This allows switching ".untaint" to ".tap(&Gem::UNTAINT)",
+ # to avoid deprecation warnings in Ruby 2.7.
+ UNTAINT = RUBY_VERSION < '2.7' ? :untaint.to_sym : proc{}
+
##
# An Array of Regexps that match windows Ruby platforms.
@@ -521,7 +526,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
glob_with_suffixes = "#{glob}#{Gem.suffix_pattern}"
$LOAD_PATH.map do |load_path|
Gem::Util.glob_files_in_dir(glob_with_suffixes, load_path)
- end.flatten.select { |file| File.file? file.untaint }
+ end.flatten.select { |file| File.file? file.tap(&Gem::UNTAINT) }
end
##
@@ -1083,7 +1088,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
# The home directory for the user.
def self.user_home
- @user_home ||= find_home.untaint
+ @user_home ||= find_home.tap(&Gem::UNTAINT)
end
##
@@ -1150,7 +1155,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
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.untaint)
+ files << load_path_file if File.file?(load_path_file.tap(&Gem::UNTAINT))
end
end
@@ -1196,7 +1201,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
end
end
- path.untaint
+ path.tap(&Gem::UNTAINT)
unless File.file? path
return unless raise_exception