class Fuzz::Screen
Constants
- COLORS
Attributes
errout[R]
input[R]
output[R]
Public Class Methods
new(output = STDOUT, input = STDIN, errout = STDERR)
click to toggle source
# File lib/fuzz/screen.rb, line 50 def initialize(output = STDOUT, input = STDIN, errout = STDERR) @output = output @input = input @errout = errout @colorize = output.tty? && Fuzz::Sys.has_ansi? end
Public Instance Methods
colorize?()
click to toggle source
# File lib/fuzz/screen.rb, line 59 def colorize? @colorize end
error_print(*args)
click to toggle source
# File lib/fuzz/screen.rb, line 75 def error_print(*args) errout.print args.flatten.collect {|a| (colorize? && Color === a) ? a.code : a }.join end
error_println(*args)
click to toggle source
# File lib/fuzz/screen.rb, line 79 def error_println(*args) errout.puts args.flatten.collect {|a| (colorize? && Color === a) ? a.code : a }.join end
output_cols()
click to toggle source
# File lib/fuzz/screen.rb, line 63 def output_cols 80 end
print(*args)
click to toggle source
# File lib/fuzz/screen.rb, line 67 def print(*args) output.print args.flatten.collect {|a| (colorize? && Color === a) ? a.code : a }.join end
println(*args)
click to toggle source
# File lib/fuzz/screen.rb, line 71 def println(*args) output.puts args.flatten.collect {|a| (colorize? && Color === a) ? a.code : a }.join end