Class: Train::Transports::Local::Connection

Inherits:
BaseConnection
  • Object
show all
Defined in:
lib/train/transports/local.rb

Defined Under Namespace

Classes: GenericRunner, WindowsPipeRunner, WindowsShellRunner

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Connection

Returns a new instance of Connection.



20
21
22
23
24
25
26
27
28
# File 'lib/train/transports/local.rb', line 20

def initialize(options)
  super(options)

  @runner = if options[:command_runner]
              force_runner(options[:command_runner])
            else
              select_runner(options)
            end
end

Instance Method Details

#closeObject



34
35
36
# File 'lib/train/transports/local.rb', line 34

def close
  @runner.close
end

#download(remotes, local) ⇒ Object



50
51
52
# File 'lib/train/transports/local.rb', line 50

def download(remotes, local)
  upload(remotes, local)
end

#login_commandObject



30
31
32
# File 'lib/train/transports/local.rb', line 30

def 
  nil # none, open your shell
end

#upload(locals, remote) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/train/transports/local.rb', line 42

def upload(locals, remote)
  FileUtils.mkdir_p(remote)

  Array(locals).each do |local|
    FileUtils.cp_r(local, remote)
  end
end

#uriObject



38
39
40
# File 'lib/train/transports/local.rb', line 38

def uri
  "local://"
end