summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext
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/core_ext
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/core_ext')
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb10
-rw-r--r--lib/rubygems/core_ext/kernel_require.rb2
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/rubygems/core_ext/kernel_gem.rb b/lib/rubygems/core_ext/kernel_gem.rb
index fb3053f..e722225 100644
--- a/lib/rubygems/core_ext/kernel_gem.rb
+++ b/lib/rubygems/core_ext/kernel_gem.rb
@@ -61,9 +61,13 @@ module Kernel
spec = dep.to_spec
- Gem::LOADED_SPECS_MUTEX.synchronize do
- spec.activate
- end if spec
+ if spec
+ if Gem::LOADED_SPECS_MUTEX.owned?
+ spec.activate
+ else
+ Gem::LOADED_SPECS_MUTEX.synchronize { spec.activate }
+ end
+ end
end
private :gem
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index 858f099..f0409d6 100644
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -41,7 +41,7 @@ module Kernel
resolved_path = begin
rp = nil
$LOAD_PATH[0...Gem.load_path_insert_index || -1].each do |lp|
- safe_lp = lp.dup.untaint
+ safe_lp = lp.dup.tap(&Gem::UNTAINT)
next if File.symlink? safe_lp # for backword compatibility
Gem.suffixes.each do |s|
full_path = File.expand_path(File.join(safe_lp, "#{path}#{s}"))