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.



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

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



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

def close
  @runner.close
end

#download(remotes, local) ⇒ Object



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

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

#login_commandObject



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

def 
  nil # none, open your shell
end

#upload(locals, remote) ⇒ Object



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

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

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

#uriObject



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

def uri
  "local://"
end