Class: SSHKit::Backend::Abstract

Inherits:
Object
  • Object
show all
Includes:
CommandEnvMerge
Defined in:
lib/kamal/sshkit_with_ext.rb

Defined Under Namespace

Modules: CommandEnvMerge

Instance Method Summary collapse

Instance Method Details

#capture_with_debug(*args, **kwargs) ⇒ Object



14
15
16
# File 'lib/kamal/sshkit_with_ext.rb', line 14

def capture_with_debug(*args, **kwargs)
  capture(*args, **kwargs, verbosity: Logger::DEBUG)
end

#capture_with_info(*args, **kwargs) ⇒ Object



10
11
12
# File 'lib/kamal/sshkit_with_ext.rb', line 10

def capture_with_info(*args, **kwargs)
  capture(*args, **kwargs, verbosity: Logger::INFO)
end

#capture_with_pretty_json(*args, **kwargs) ⇒ Object



18
19
20
# File 'lib/kamal/sshkit_with_ext.rb', line 18

def capture_with_pretty_json(*args, **kwargs)
  JSON.pretty_generate(JSON.parse(capture(*args, **kwargs)))
end

#puts_by_host(host, output, type: "App", quiet: false, raw: false) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/kamal/sshkit_with_ext.rb', line 22

def puts_by_host(host, output, type: "App", quiet: false, raw: false)
  if raw
    $stdout.binmode
    $stdout.write(output)
  else
    unless quiet
      puts "#{type} Host: #{host}"
    end
    puts "#{output}\n\n"
  end
end