class Dockerspec::Builder::Logger::Info

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

Public Class Methods

new(output = STDOUT) click to toggle source

Creates a Info logger instance.

@param output [IO] the output stream.

@api public

# File lib/dockerspec/builder/logger/info.rb, line 35
def initialize(output = STDOUT)
  @output = output
  @status = nil
end

Public Instance Methods

print_chunk(chunk) click to toggle source

Prints the Docker build chunk.

@param chunk [Hash] The docker build chunk.

@return void

@api public

Protected Instance Methods

parse_chunk(chunk) click to toggle source

Parses the Docker build process chunk.

@param chunk [String] The chunk in JSON.

@return [Hash] The chunk parsed as a Hash.

@api private

# File lib/dockerspec/builder/logger/info.rb, line 67
def parse_chunk(chunk)
  return chunk if chunk.is_a?(Hash)
  JSON.parse(chunk)
rescue JSON::ParserError
  { 'stream' => chunk }
end
print_status(status) click to toggle source

Prints progress status in a shorter format.

For example: `'Downloading.….nExtracting..`'.

@param status [String] The name of the current status.

@return void

@api private

print_stream(stream) click to toggle source

Prints the stream.

@param stream [String] The text to print.

@return void

@api private