diff options
author | Erik Michaels-Ober <sferik@gmail.com> | 2011-12-02 19:44:23 -0800 |
---|---|---|
committer | Erik Michaels-Ober <sferik@gmail.com> | 2011-12-02 19:44:23 -0800 |
commit | 26fa77aea2c8dc7d738b7df355206966043c9b96 (patch) | |
tree | aeddc9e0e8504188931c2e2d30295dc558e81807 | |
parent | 36c9f92a9fa4ff8f8700d27d426c553c37be361f (diff) | |
download | bundler-26fa77aea2c8dc7d738b7df355206966043c9b96.tar.gz |
Not all executables are binary
-rw-r--r-- | lib/bundler.rb | 10 |
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 |