lib/mini_magick/utilities.rb in mini_magick-4.5.1 vs lib/mini_magick/utilities.rb in mini_magick-4.6.0
- old
+ new
@@ -12,10 +12,10 @@
# @example
# MiniMagick::Utilities.which('ruby') #=> "/usr/bin/ruby"
#
def which(cmd)
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
- ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
+ ENV.fetch('PATH').split(File::PATH_SEPARATOR).each do |path|
exts.each do |ext|
exe = File.join(path, "#{cmd}#{ext}")
return exe if File.executable? exe
end
end