summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-02-29 20:56:51 -0600
committerSamuel Giddins <segiddins@segiddins.me>2016-02-29 20:56:51 -0600
commitf8d07b1446a8e2e42468a2676b9fe47d9f3d1089 (patch)
tree5793dace0d3661aa872ae7fb6848c530f76ab7ce
parentf590c8b5b6d845cd10c87fa1a3c1f6ea049f56ef (diff)
downloadbundler-f8d07b1446a8e2e42468a2676b9fe47d9f3d1089.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