summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunichi Morimoto <morimoto@elysium.co.jp>2015-03-12 16:33:34 +0900
committerAndre Arko <andre@arko.net>2015-03-12 11:12:59 -0700
commitb41357489b63cfbc1b957e575e495e1383d5c9cb (patch)
tree453c9868fab390cf2b810c458c60252002b482b4
parent56b64f5abeac20c7b046073d8c0de903d6429afb (diff)
downloadbundler-b41357489b63cfbc1b957e575e495e1383d5c9cb.tar.gz
Fix Bundler::which
Bundler::which doesn't return nil if the argument is a name of directory. This is because File::executable? returns true when its argument is a name of directory. similar to 628927b6eebf2523ad18f7042da6ac598d000d61
-rw-r--r--lib/bundler.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 025337418c..38a3de0f38 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -316,7 +316,8 @@ module Bundler
executable
elsif ENV['PATH']
path = ENV['PATH'].split(File::PATH_SEPARATOR).find do |p|
- File.executable?(File.join(p, executable))
+ abs_path = File.join(p, executable)
+ File.file?(abs_path) && File.executable?(abs_path)
end
path && File.expand_path(executable, path)
end