Sha256: e3fdd7c3e223bb72dd969b74509ce272601fef3f527f3457d925f7fd5a99a6c0

Contents?: true

Size: 611 Bytes

Versions: 12

Compression:

Stored size: 611 Bytes

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2021-2023, 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

12 entries across 12 versions & 1 rubygems

Version Path
console-1.24.0 lib/console/output.rb
console-1.23.7 lib/console/output.rb
console-1.23.6 lib/console/output.rb
console-1.23.5 lib/console/output.rb
console-1.23.4 lib/console/output.rb
console-1.23.3 lib/console/output.rb
console-1.23.2 lib/console/output.rb
console-1.23.1 lib/console/output.rb
console-1.23.0 lib/console/output.rb
console-1.22.0 lib/console/output.rb
console-1.21.0 lib/console/output.rb
console-1.20.0 lib/console/output.rb