diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb index 51c043d5fc..3c69a5a2fe 100644 --- a/lib/rubygems/basic_specification.rb +++ b/lib/rubygems/basic_specification.rb @@ -174,11 +174,13 @@ class Gem::BasicSpecification begin fullpath = nil suffixes = Gem.suffixes - suffixes.find do |suf| + if suffixes.find do |suf| full_require_paths.find do |dir| File.file?(fullpath = "#{dir}/#{path}#{suf}") end - end ? fullpath : nil + end + fullpath + end end end end diff --git a/lib/rubygems/request.rb b/lib/rubygems/request.rb index 30e2582ac5..0303649d05 100644 --- a/lib/rubygems/request.rb +++ b/lib/rubygems/request.rb @@ -171,8 +171,7 @@ class Gem::Request no_env_proxy = env_proxy.nil? || env_proxy.empty? if no_env_proxy - return ["https", "http"].include?(downcase_scheme) ? - :no_proxy : get_proxy_from_env("http") + return ["https", "http"].include?(downcase_scheme) ? :no_proxy : get_proxy_from_env("http") end require "uri" diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb index ba30a06080..650eda076e 100644 --- a/test/rubygems/test_gem_installer.rb +++ b/test/rubygems/test_gem_installer.rb @@ -341,8 +341,11 @@ gem 'other', version end def test_generate_bin_bindir_with_user_install_warning - bin_dir = Gem.win_platform? ? File.expand_path(ENV["WINDIR"]).upcase : - "/usr/bin" + bin_dir = if Gem.win_platform? + File.expand_path(ENV["WINDIR"]).upcase + else + "/usr/bin" + end old_path = ENV["PATH"] ENV["PATH"] = [ENV["PATH"], bin_dir].compact.join(File::PATH_SEPARATOR)