Class: Kitchen::Transport::Localhost::Connection
- Inherits:
-
Base::Connection
- Object
- Base::Connection
- Kitchen::Transport::Localhost::Connection
- Includes:
- ShellOut
- Defined in:
- lib/kitchen/transport/localhost/connection.rb
Overview
Connection class for the Localhost transport.
Instance Method Summary collapse
-
#execute(command) ⇒ Object
Execute a given command by shelling out and just running it.
-
#upload(locals, remote) ⇒ Object
Upload a set of local files to a ‘remote’ (aka Kitchen temp dir).
Instance Method Details
#execute(command) ⇒ Object
Execute a given command by shelling out and just running it.
(see Base::Connection#execute)
43 44 45 46 47 48 49 50 51 |
# File 'lib/kitchen/transport/localhost/connection.rb', line 43 def execute(command) return if command.nil? logger.debug("[Localhost] #{self} (#{command})") begin Bundler.with_clean_env { run_command(command) } rescue StandardError => err raise(Kitchen::Transport::LocalhostFailed, err.) end end |
#upload(locals, remote) ⇒ Object
Upload a set of local files to a ‘remote’ (aka Kitchen temp dir)
(see Base::Connection#upload)
58 59 60 61 62 63 64 65 |
# File 'lib/kitchen/transport/localhost/connection.rb', line 58 def upload(locals, remote) FileUtils.mkdir_p(remote) Array(locals).each do |local| FileUtils.cp_r(local, remote) logger.debug("[Localhost] Copied '#{local}' to '#{remote}'") end logger.debug("[Localhost] File copying to '#{remote}' complete") end |