Sha256: db1d233dc2c9bf5ca95da6daa2855805d61179fc3c49f6c4d947a4884ae24371

Contents?: true

Size: 749 Bytes

Versions: 6

Compression:

Stored size: 749 Bytes

Contents

# frozen_string_literal: true

module Bolt
  class Outputter
    def self.for_format(format, color, verbose, trace)
      case format
      when 'human'
        Bolt::Outputter::Human.new(color, verbose, trace)
      when 'json'
        Bolt::Outputter::JSON.new(color, verbose, trace)
      when 'rainbow'
        Bolt::Outputter::Rainbow.new(color, verbose, trace)
      when nil
        raise "Cannot use outputter before parsing."
      end
    end

    def initialize(color, verbose, trace, stream = $stdout)
      @color = color
      @verbose = verbose
      @trace = trace
      @stream = stream
    end
  end
end

require 'bolt/outputter/human'
require 'bolt/outputter/json'
require 'bolt/outputter/logger'
require 'bolt/outputter/rainbow'

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bolt-2.22.0 lib/bolt/outputter.rb
bolt-2.21.0 lib/bolt/outputter.rb
bolt-2.20.0 lib/bolt/outputter.rb
bolt-2.19.0 lib/bolt/outputter.rb
bolt-2.18.0 lib/bolt/outputter.rb
bolt-2.17.0 lib/bolt/outputter.rb