Sha256: 7512b8fdf3146aa6aa182fac9548ceae27db3043dbbee8d8fdd7eea9203b13ca

Contents?: true

Size: 611 Bytes

Versions: 2

Compression:

Stored size: 611 Bytes

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2021-2022, by Samuel Williams.

require_relative 'output/default'
require_relative 'output/json'
require_relative 'output/text'
require_relative 'output/xterm'
require_relative 'output/null'

module Console
	module Output
		def self.new(output = nil, env = ENV, **options)
			if names = env['CONSOLE_OUTPUT']
				names = names.split(',').reverse
				
				names.inject(output) do |output, name|
					Output.const_get(name).new(output, **options)
				end
			else
				return Output::Default.new(output, **options)
			end
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
console-1.19.0 lib/console/output.rb
console-1.18.0 lib/console/output.rb