Class: SSHKit::Formatter::Pretty

Inherits:
Abstract
  • Object
show all
Defined in:
lib/capup/fix/sshkit/pretty.rb

Instance Method Summary collapse

Instance Method Details

#write(obj) ⇒ Object Also known as: <<



9
10
11
12
13
14
15
16
17
# File 'lib/capup/fix/sshkit/pretty.rb', line 9

def write(obj)
  return if obj.verbosity < SSHKit.config.output_verbosity
  case obj
  when SSHKit::Command    then write_command(obj)
  when SSHKit::LogMessage then write_log_message(obj)
  else
    original_output << c.black(c.on_yellow("Output formatter doesn't know how to handle #{obj.class}\n"))
  end
end