Class: Toolshed::Commands::SCP::Download

Inherits:
Toolshed::Commands::SCPBase show all
Defined in:
lib/toolshed/commands/scp/download.rb

Overview

Responsible for handing downloading of files

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, parse, #read_user_input, #read_user_input_body, #read_user_input_password, #read_user_input_title, #use_project_id, #use_ticket_tracker_by_type, #use_ticket_tracker_project_id, #use_ticket_tracker_project_name

Constructor Details

This class inherits a constructor from Toolshed::Commands::Base

Class Method Details

.cli_optionsObject

rubocop:disable MethodLength



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/toolshed/commands/scp/download.rb', line 8

def self.cli_options # rubocop:disable MethodLength
  {
    banner: 'Usage: scp download [options]',
    options: {
      remote_host: {
        short_on: '-r'
      },
      remote_path: {
        short_on: '-d'
      },
      local_path: {
        short_on: '-s'
      },
      username: {
        short_on: '-u'
      },
      password: {
        short_on: '-p'
      },
      verbose_output: {
        short_on: '-v'
      }
    }
  }
end

Instance Method Details

#execute(_args, options = nil) ⇒ Object



34
35
36
37
38
39
# File 'lib/toolshed/commands/scp/download.rb', line 34

def execute(_args, options = nil)
  options ||= nil
  Toolshed.logger.info ''
  Toolshed::ServerAdministration::SCP.new(scp_options(options)).download
  Toolshed.die
end