summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-02-29 20:56:51 -0600
committerAndre Arko <andre@arko.net>2016-03-12 00:23:26 -0800
commitbadc5c2b69863d063b964a841f09d0286c59cd26 (patch)
tree344a87a7aebf10e54816d9c0273509e9ebda302d
parent9422b27c4a2d9299308451d44a1513811bf8cfc1 (diff)
downloadbundler-badc5c2b69863d063b964a841f09d0286c59cd26.tar.gz
Fix which to compare quotes correctly on 1.8.7
-rw-r--r--lib/bundler.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 3516cf75d9..dcb151b058 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -304,8 +304,9 @@ module Bundler
if File.file?(executable) && File.executable?(executable)
executable
elsif paths = ENV["PATH"]
+ quote = '"'.freeze
paths.split(File::PATH_SEPARATOR).find do |path|
- path = path[1..-2] if path[0] == '"' && path[-1] == '"'
+ path = path[1..-2] if path.start_with?(quote) && path.end_with?(quote)
executable_path = File.expand_path(executable, path)
return executable_path if File.file?(executable_path) && File.executable?(executable_path)
end