Class: SmartMachine::SCP

Inherits:
Base
  • Object
show all
Defined in:
lib/smart_machine/scp.rb

Instance Method Summary collapse

Methods inherited from Base

#machine_has_engine_installed?, #platform_on_machine?, #user_bash

Methods included from Logger

configure_logger_for, included, #logger, logger_for

Constructor Details

#initializeSCP

Returns a new instance of SCP.



3
4
5
6
7
8
# File 'lib/smart_machine/scp.rb', line 3

def initialize
  @address  = SmartMachine.credentials.machine[:address]
  @port     = SmartMachine.credentials.machine[:port]
  @username = SmartMachine.credentials.machine[:username]
  @password = SmartMachine.credentials.machine[:password]
end

Instance Method Details

#upload!(local_path:, remote_path:) ⇒ Object



10
11
12
13
# File 'lib/smart_machine/scp.rb', line 10

def upload!(local_path:, remote_path:)
  system("scp -q -P #{@port} #{local_path} #{@username}@#{@address}:#{remote_path}")
  $?
end