Sha256: 360f1d5fcd77b8d644bb08c18fd2c0b84ebea5a5c6237ccbad732c788f9f7bb7

Contents?: true

Size: 733 Bytes

Versions: 14

Compression:

Stored size: 733 Bytes

Contents

require 'net/scp'
module Mccloud::Provider
  module Host
    module VmCommand

      def transfer(src,dest,options = {})
        scp(src,dest,options)
      end

      def scp(src,dest,options = {})

        # override options from Mccloudfile with parameter options
        ssh_options = mccloudfile_options.merge(options)
        
        Net::SCP.start(ip_address,ssh_options[:user],ssh_options) do |auth_scp|
          auth_scp.upload!(src,dest)
        end
      end

      def mccloudfile_options
        opts = Hash.new
        (opts[:user] = @user) if @user
        (opts[:keys] = @private_key_path) if @private_key_path
        (opts[:port] = @port) if @port
        opts
      end

   end #module
  end #module
end #module

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mccloud-0.1.1 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.28 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.27 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.26 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.25 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.24 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.23 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.22 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.21 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.20 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.19 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.18 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.17 lib/mccloud/provider/host/vm/scp.rb
mccloud-0.0.16 lib/mccloud/provider/host/vm/scp.rb