Sha256: 8c58d1eb20457db8f021761d7a525c7104beb408734ac937f1142db115a85de1

Contents?: true

Size: 391 Bytes

Versions: 20

Compression:

Stored size: 391 Bytes

Contents

# frozen_string_literal: true

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

require 'stringio'

module Console
	class Buffer < StringIO
		def initialize(prefix = nil)
			@prefix = prefix
			
			super()
		end
		
		def puts(*args, prefix: @prefix)
			args.each do |arg|
				self.write(prefix) if prefix
				super(arg)
			end
		end
		
		alias << puts
	end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
console-1.24.0 lib/console/buffer.rb
console-1.23.7 lib/console/buffer.rb
console-1.23.6 lib/console/buffer.rb
console-1.23.5 lib/console/buffer.rb
console-1.23.4 lib/console/buffer.rb
console-1.23.3 lib/console/buffer.rb
console-1.23.2 lib/console/buffer.rb
console-1.23.1 lib/console/buffer.rb
console-1.23.0 lib/console/buffer.rb
console-1.22.0 lib/console/buffer.rb
console-1.21.0 lib/console/buffer.rb
console-1.20.0 lib/console/buffer.rb
console-1.19.0 lib/console/buffer.rb
console-1.18.0 lib/console/buffer.rb
console-1.17.4 lib/console/buffer.rb
console-1.17.3 lib/console/buffer.rb
console-1.17.2 lib/console/buffer.rb
console-1.17.1 lib/console/buffer.rb
console-1.17.0 lib/console/buffer.rb
console-1.16.2 lib/console/buffer.rb