Class: PlainFormatter

Inherits:
SSHKit::Formatter::Abstract
  • Object
show all
Defined in:
lib/docker_deploy.rb

Overview

Improvement on the broken piece of crap text formatter in SSHKit.

Instance Method Summary collapse

Constructor Details

#initialize(io = $stdout) ⇒ PlainFormatter

Returns a new instance of PlainFormatter.



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

def initialize(io = $stdout)
  @io = io
end

Instance Method Details

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



18
19
20
21
22
23
24
# File 'lib/docker_deploy.rb', line 18

def write(obj)
  if obj.is_a?(SSHKit::Command)
    @io.write(obj.stdout)
  else
    @io.write(obj.to_s)
  end
end