summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhysd <lin90162@yahoo.co.jp>2013-11-07 02:50:14 +0900
committerrhysd <lin90162@yahoo.co.jp>2013-11-07 02:50:14 +0900
commit0b955b6f97069917666326627aa027b66b81c635 (patch)
tree23b5479584da06953c4a6da567df0946528bda3d
parent02af5bcc0631c4b99d8081348b49471778d34d95 (diff)
downloadbundler-0b955b6f97069917666326627aa027b66b81c635.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. I fixed it with File::file?.
-rw-r--r--lib/bundler.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 1c6e3bacf2..50fed96955 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -290,7 +290,7 @@ module Bundler
end
def which(executable)
- if File.executable?(executable)
+ if File.file?(executable) && File.executable?(executable)
executable
elsif ENV['PATH']
path = ENV['PATH'].split(File::PATH_SEPARATOR).find do |p|