rake SshFilePublisher on port different from standard 22

I am testing rake file upload, running well rcp in a terminal

scp -v -P 666 -q /Users/kadoudal/musicians.xml
kadoudal@mydomain.com:httpdocs/var/www/html/jazz_people

but when running from the rake file

  publisher = Rake::SshFilePublisher.new(
                          "kadoudal@ mydomain.com",
                          "/httpdocs/var/www/html/jazz_people",
                          File.dirname(__FILE__),
                          t.prerequisites.first)
  publisher.upload

I get an error, which quite normal as I should precise the port 666

how can I do it ? there is no publisher.option ?

thanks for your help

note : I also tried "kadoudal@ mydomain.com:666" as a host .. no way
error
Command failed with status (1): [scp -q ......

Kad Kerforn wrote:

I am testing rake file upload, running well rcp in a terminal

scp -v -P 666 -q /Users/kadoudal/musicians.xml
kadoudal@mydomain.com:httpdocs/var/www/html/jazz_people

but when running from the rake file

  publisher = Rake::SshFilePublisher.new(
                          "kadoudal@ mydomain.com",
                          "/httpdocs/var/www/html/jazz_people",
                          File.dirname(__FILE__),
                          t.prerequisites.first)
  publisher.upload

I get an error, which quite normal as I should precise the port 666

how can I do it ? there is no publisher.option ?

thanks for your help

note : I also tried "kadoudal@ mydomain.com:666" as a host .. no way
error
Command failed with status (1): [scp -q ......

ok solved with a patch in gem rake/contrib/sshpublisher.rb

    # Upload the local directory to the remote directory on non-standard
port
    def upload_port(port=22)
      @files.each do |fn|
        sh %{scp -P #{port} -q #{@local_dir}/#{fn}
#{@host}:#{@remote_dir}}
      end
    end

now I can do publisher.upload_port(666)

You can also specify the port to use for a specific host in your own
~/.ssh/config file -- man ssh_config

FWIW,

Hassan Schroeder wrote: