From 85d461456c154d7b4a72b20369e0d65d7880ce02 Mon Sep 17 00:00:00 2001 From: hsbt Date: Mon, 27 Aug 2018 10:05:04 +0000 Subject: Merge master branch from rubygems upstream. * It's preparation to release RubyGems 3.0.0.beta2 and Ruby 2.6.0 preview 3. * https://github.com/rubygems/rubygems/compare/v3.0.0.beta1...fad2eb15a282b19dfcb4b48bc95b8b39ebb4511f git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/util.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/rubygems/util.rb') diff --git a/lib/rubygems/util.rb b/lib/rubygems/util.rb index 9f5b9a2239..6dbcd4ba21 100644 --- a/lib/rubygems/util.rb +++ b/lib/rubygems/util.rb @@ -80,8 +80,6 @@ module Gem::Util end return system(*(cmds << opt)) rescue TypeError - require 'thread' - @silent_mutex ||= Mutex.new @silent_mutex.synchronize do @@ -118,4 +116,16 @@ module Gem::Util end end + ## + # Globs for files matching +pattern+ inside of +directory+, + # returning absolute paths to the matching files. + + def self.glob_files_in_dir(glob, base_path) + if RUBY_VERSION >= "2.5" + Dir.glob(glob, base: base_path).map! {|f| File.join(base_path, f) } + else + Dir.glob(File.expand_path(glob, base_path)) + end + end + end -- cgit v1.2.3