Module: Escualo::Script
- Defined in:
- lib/escualo/script.rb
Class Method Summary collapse
- .commands(escualo, script, extra) ⇒ Object
- .delegated_options(options) ⇒ Object
- .run!(session, escualo, script, extra = '') ⇒ Object
Class Method Details
.commands(escualo, script, extra) ⇒ Object
3 4 5 |
# File 'lib/escualo/script.rb', line 3 def self.commands(escualo, script, extra) (script||[]).map { |it| "#{escualo} #{it} #{extra}" } end |
.delegated_options(options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/escualo/script.rb', line 7 def self.() [.hostname.try { |it| "--hostname #{it}" }, .username.try { |it| "--username #{it}" }, .password.try { |it| "--ssh-password #{it}" }, .ssh_key.try { |it| "--ssh-key #{it}" }, .ssh_port.try { |it| "--ssh-port #{it}" }, .trace && '--trace', .verbose && '--verbose', ].compact.join(' ') end |
.run!(session, escualo, script, extra = '') ⇒ Object
18 19 20 21 22 |
# File 'lib/escualo/script.rb', line 18 def self.run!(session, escualo, script, extra='') Escualo::Script.commands(escualo, script, extra).each do |command| session. command end end |