Sha256: 598f3cbd3b90686e6841deab1d71fc30cd4ba356bf173ce552ef3d2a13926274

Contents?: true

Size: 589 Bytes

Versions: 3

Compression:

Stored size: 589 Bytes

Contents

# frozen_string_literal: true

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

require_relative "output/default"
require_relative "output/serialized"
require_relative "output/terminal"
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

3 entries across 3 versions & 1 rubygems

Version Path
console-1.29.0 lib/console/output.rb
console-1.28.1 lib/console/output.rb
console-1.28.0 lib/console/output.rb