Class: Dockerspec::Builder::Logger::Info

Inherits:
Object
  • Object
show all
Defined in:
lib/dockerspec/builder/logger/info.rb

Overview

A Dockerspec::Builder logger that gives information about main build steps.

Direct Known Subclasses

CI, Debug

Instance Method Summary collapse

Constructor Details

#initialize(output = STDOUT) ⇒ Info

Creates a Info logger instance.

Parameters:

  • output (IO) (defaults to: STDOUT)

    the output stream.



35
36
37
38
# File 'lib/dockerspec/builder/logger/info.rb', line 35

def initialize(output = STDOUT)
  @output = output
  @status = nil
end

Instance Method Details

Prints the Docker build chunk.

Parameters:

  • chunk (Hash)

    The docker build chunk.

Returns:

  • void



49
50
51
52
53
54
# File 'lib/dockerspec/builder/logger/info.rb', line 49

def print_chunk(chunk)
  chunk_json = parse_chunk(chunk)
  print_status(chunk_json['status'])
  return unless chunk_json.key?('stream')
  print_stream(chunk_json['stream'])
end