# class Chef::Formatters::Outputter

## Outputter¶ ↑

Handles basic printing tasks like colorizing. – TODO: Duplicates functionality from knife, upfactor.

### Attributes

err[R]
out[R]

### Public Class Methods

new(out, err) click to toggle source

    # File lib/chef/formatters/base.rb, line 68
    def initialize(out, err)
      @out, @err = out, err
    end

### Public Instance Methods

color(string, *colors) click to toggle source

    # File lib/chef/formatters/base.rb, line 79
    def color(string, *colors)
      if Chef::Config[:color]
        @out.print highline.color(string, *colors)
      else
        @out.print string
      end
    end

Also aliased as: print
highline() click to toggle source

    # File lib/chef/formatters/base.rb, line 72
    def highline
      @highline ||= begin
        require 'highline'
        HighLine.new
      end
    end

print(string, *colors)
Alias for: color
puts(string, *colors) click to toggle source

    # File lib/chef/formatters/base.rb, line 89
    def puts(string, *colors)
      if Chef::Config[:color]
        @out.puts highline.color(string, *colors)
      else
        @out.puts string
      end
    end