1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Make sure Net::SSH versions prior to 1.1.0 still work

git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7050 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2007-06-17 20:13:08 +00:00
parent 4d49ecad8b
commit f800260e0f
2 changed files with 18 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Make sure Net::SSH versions prior to 1.1.0 still work [Jamis Buck]
* Allow the :hosts and :roles keys to accept lambdas, which will be evaluated lazily to allow runtime selection of hosts and roles in tasks [Jamis Buck]
* Use `which' to test whether a command exists in the remote path, instead of `test -p' [Jamis Buck]

View file

@ -31,7 +31,22 @@ module Capistrano
)
net_ssh_dependencies << "userauth/pageant" if File::ALT_SEPARATOR
net_ssh_dependencies.each { |path| require "net/ssh/#{path}" }
net_ssh_dependencies.each do |path|
begin
require "net/ssh/#{path}"
rescue LoadError
# Ignore load errors from this, since some files are in the list which
# do not exist in different (supported) versions of Net::SSH. We know
# (by this point) that Net::SSH is installed, though, since we do a
# require 'net/ssh' at the very top of this file, and we know the
# installed version meets the minimum version requirements because of
# the version check, also at the top of this file. So, if we get a
# LoadError, it's simply because the file in question does not exist in
# the version of Net::SSH that is installed.
#
# Whew!
end
end
# A helper class for dealing with SSH connections.
class SSH