I'm trying create a program using ruby (and Net::SSH) to connect to servers and perform some tasks. The details of the server are to be provided as something like:
ssh://user:pass@host:port (for a host that does not yet have SSH keys)
or
user@host
Net::SSH expects the following format:
Net::SSH.start('host', 'user', :password => "password")
Is there are gem/stdlib that can process the URL into this format? Or a simple regex that can match the different parts?
Note: I'm aware of, and use, capistrano but in this case I need lower level control.