diff --git a/lib/vagrant/util/ssh.rb b/lib/vagrant/util/ssh.rb index fa211e3f3..912ef4645 100644 --- a/lib/vagrant/util/ssh.rb +++ b/lib/vagrant/util/ssh.rb @@ -1,9 +1,9 @@ require "log4r" -require "vagrant/util/file_util" require "vagrant/util/file_mode" require "vagrant/util/platform" require "vagrant/util/safe_exec" +require "vagrant/util/which" module Vagrant module Util @@ -55,7 +55,7 @@ module Vagrant def self.exec(ssh_info, opts={}) # Ensure the platform supports ssh. On Windows there are several programs which # include ssh, notably git, mingw and cygwin, but make sure ssh is in the path! - if !FileUtil.which("ssh") + if !Which.which("ssh") if Platform.windows? raise Errors::SSHUnavailableWindows, :host => ssh_info[:host], diff --git a/lib/vagrant/util/file_util.rb b/lib/vagrant/util/which.rb similarity index 98% rename from lib/vagrant/util/file_util.rb rename to lib/vagrant/util/which.rb index 89917a740..090d84010 100644 --- a/lib/vagrant/util/file_util.rb +++ b/lib/vagrant/util/which.rb @@ -2,7 +2,7 @@ require "vagrant/util/platform" module Vagrant module Util - class FileUtil + class Which # Cross-platform way of finding an executable in the PATH. # # which('ruby') #=> /usr/bin/ruby