Module: Escualo::Script

Defined in:
lib/escualo/script.rb

Defined Under Namespace

Classes: Dockerized, Mode, Standard

Class Method Summary collapse

Class Method Details

.delegated_options(options) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/escualo/script.rb', line 7

def self.delegated_options(options)
  [options.hostname.try { |it| "--hostname #{it}" },
   options.username.try { |it| "--username #{it}" },
   options.password.try { |it| "--password #{it}" },
   options.ssh_key.try { |it| "--ssh-key #{it}" },
   options.ssh_port.try { |it| "--ssh-port #{it}" },
   options.trace && '--trace',
   options.verbose && '--verbose'
  ].compact.join(' ')
end

.each_command(script, extra = '', &block) ⇒ Object



3
4
5
# File 'lib/escualo/script.rb', line 3

def self.each_command(script, extra='', &block)
  script.map { |it| "escualo #{it} #{extra}" }.each(&block) if script
end