summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Michaels-Ober <sferik@gmail.com>2011-12-02 19:44:23 -0800
committerErik Michaels-Ober <sferik@gmail.com>2011-12-02 19:44:23 -0800
commit26fa77aea2c8dc7d738b7df355206966043c9b96 (patch)
treeaeddc9e0e8504188931c2e2d30295dc558e81807
parent36c9f92a9fa4ff8f8700d27d426c553c37be361f (diff)
downloadbundler-26fa77aea2c8dc7d738b7df355206966043c9b96.tar.gz
Not all executables are binary
-rw-r--r--lib/bundler.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 53b5125101..e5764da122 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -246,14 +246,14 @@ module Bundler
end
end
- def which(binary)
- if File.executable? binary
- binary
+ def which(executable)
+ if File.executable?(executable)
+ executable
else
path = ENV['PATH'].split(File::PATH_SEPARATOR).find { |path|
- File.executable? File.join(path, binary)
+ File.executable?(File.join(path, executable))
}
- path && File.expand_path(binary, path)
+ path && File.expand_path(executable, path)
end
end