summaryrefslogtreecommitdiff
path: root/lib/rubygems/util.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-27 10:05:04 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-27 10:05:04 +0000
commit85d461456c154d7b4a72b20369e0d65d7880ce02 (patch)
tree21e1be2c786c8040a426841768e046fb4dc365b1 /lib/rubygems/util.rb
parent3a83ba90c35833bab757998def36cfe872dec461 (diff)
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
Diffstat (limited to 'lib/rubygems/util.rb')
-rw-r--r--lib/rubygems/util.rb14
1 files changed, 12 insertions, 2 deletions
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