Sha256: 5a3181086c0787f60509e1ed62c6321763290435e6c3a7ffbfb5005701b72236

Contents?: true

Size: 440 Bytes

Versions: 1

Compression:

Stored size: 440 Bytes

Contents

module Putsplus
	#
	# Sticks text to last line in console
	#	
	class Footer
		attr_reader :thread
		attr_accessor :text

		def initialize(text = "")
		@text = text
		@thread = Thread.new {
			while true do
				sticky_footer @text
			end
		}
		end

		def kill
			Thread.kill(@thread)
		end

		def sticky_footer text
			print text.to_s + "\r"
			$stdout.flush
		end

		def alive?
			@thread.alive?
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
putsplus-0.1.0 lib/putsplus/footer.rb