Sha256: e5fb19051f004dee4846d77527981748755736657d2e77154587206ceebf1017

Contents?: true

Size: 1.5 KB

Versions: 31

Compression:

Stored size: 1.5 KB

Contents

# Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

module Console
	class Split
		def self.[] *outputs
			self.new(outputs)
		end
		
		def initialize(outputs)
			@outputs = outputs
		end
		
		def verbose!(value = true)
			@outputs.each{|output| output.verbose!(value)}
		end
		
		def call(level, subject = nil, *arguments, **options, &block)
			@outputs.each do |output|
				output.call(level, subject, *arguments, **options, &block)
			end
		end
	end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
console-1.13.1 lib/console/split.rb
console-1.13.0 lib/console/split.rb
console-1.12.0 lib/console/split.rb
console-1.11.1 lib/console/split.rb
console-1.11.0 lib/console/split.rb
console-1.10.2 lib/console/split.rb
console-1.10.1 lib/console/split.rb
console-1.10.0 lib/console/split.rb
console-1.9.1 lib/console/split.rb
console-1.9.0 lib/console/split.rb
console-1.8.2 lib/console/split.rb
console-1.8.1 lib/console/split.rb
console-1.8.0 lib/console/split.rb
console-1.7.2 lib/console/split.rb
console-1.7.1 lib/console/split.rb
console-1.7.0 lib/console/split.rb
console-1.6.0 lib/console/split.rb
console-1.5.0 lib/console/split.rb
console-1.4.1 lib/console/split.rb
console-1.4.0 lib/console/split.rb