Class: Gerrit::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/gerrit/output.rb

Overview

Encapsulates all communication to an output source.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ Output

Creates a new Gerrit::Output instance.

Parameters:

  • stream (IO)

    the output destination stream.



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

def initialize(stream)
  @output_stream = stream
end

Class Method Details

.silentGerrit::Output

Creates a Gerrit::Output which displays nothing.

Returns:



7
8
9
# File 'lib/gerrit/output.rb', line 7

def self.silent
  new(File.open('/dev/null', 'w'))
end

Instance Method Details

Print the specified output.

Parameters:

  • output (String)

    the output to display



21
22
23
# File 'lib/gerrit/output.rb', line 21

def print(output)
  @output_stream.print(output)
end