diff options
| author | Jamis Buck <jamis@37signals.com> | 2009-01-31 23:06:30 -0700 |
|---|---|---|
| committer | Jamis Buck <jamis@37signals.com> | 2009-01-31 23:06:30 -0700 |
| commit | 6c4d8ae72e21f590045f1648c4060cb2f8d3957c (patch) | |
| tree | 4f74ce9abd4e7945c84a2518c7a3ed219a344c48 | |
| parent | edc27cff7712026d543bef8f76319ebe4371b948 (diff) | |
| download | net-ssh-6c4d8ae72e21f590045f1648c4060cb2f8d3957c.tar.gz | |
non-nil user overrides user in .ssh/config
This allows you to fall-back to the .ssh/config by specifying
nil for user, but force a different user by giving a non-nil
value.
| -rw-r--r-- | CHANGELOG.rdoc | 2 | ||||
| -rw-r--r-- | lib/net/ssh.rb | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index 9f208dd..02ee108 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -1,5 +1,7 @@ === unreleased +* Specifying non-nil user argument overrides user in .ssh/config [Jamis Buck] + * Ignore requests for non-existent channels (workaround ssh server bug) [Jamis Buck] * Add terminate! method for hard shutdown scenarios [Jamis Buck] diff --git a/lib/net/ssh.rb b/lib/net/ssh.rb index 00a878e..a752392 100644 --- a/lib/net/ssh.rb +++ b/lib/net/ssh.rb @@ -159,6 +159,7 @@ module Net else Array(options[:config]) end + options[:user] = user if user options = Net::SSH::Config.for(host, files).merge(options) host = options.fetch(:host_name, host) @@ -196,4 +197,4 @@ module Net end end end -end
\ No newline at end of file +end |
