Module: Fig::Protocol

Included in:
FTP, File, HTTP, SFTP, SSH
Defined in:
lib/fig/protocol.rb,
lib/fig/protocol/ftp.rb,
lib/fig/protocol/ssh.rb,
lib/fig/protocol/file.rb,
lib/fig/protocol/http.rb,
lib/fig/protocol/sftp.rb,
lib/fig/protocol/netrc_enabled.rb

Overview

File transfers.

Defined Under Namespace

Modules: NetRCEnabled Classes: FTP, File, HTTP, SFTP, SSH

Instance Method Summary collapse

Instance Method Details

#download(uri, path) ⇒ Object

Returns whether the file was not downloaded because the file already exists and is already up-to-date.


23
24
25
26
# File 'lib/fig/protocol.rb', line 23

def download(uri, path)
  Fig::Logging.fatal "Protocol not supported: #{uri}"
  raise Fig::NetworkError.new "Protocol not supported: #{uri}"
end

#download_list(uri) ⇒ Object


10
11
12
13
# File 'lib/fig/protocol.rb', line 10

def download_list(uri)
  Fig::Logging.fatal "Protocol not supported: #{uri}"
  raise Fig::NetworkError.new "Protocol not supported: #{uri}"
end

#path_up_to_date?(uri, path) ⇒ Boolean

Determine whether we need to update something. Returns nil to indicate “don't know”.

Returns:

  • (Boolean)

17
18
19
# File 'lib/fig/protocol.rb', line 17

def path_up_to_date?(uri, path)
  return nil # Not implemented
end

#upload(local_file, uri) ⇒ Object


28
29
30
31
# File 'lib/fig/protocol.rb', line 28

def upload(local_file, uri)
  Fig::Logging.fatal "Protocol not supported: #{uri}"
  raise Fig::NetworkError.new "Protocol not supported: #{uri}"
end