Sha256: efed6cceb0d0227bfec76158465f8b034cb6d0fabec323fc8077173d612609c2
Contents?: true
Size: 486 Bytes
Versions: 9
Compression:
Stored size: 486 Bytes
Contents
module Minimart # Wrapper for IO to provide colored output. class Output attr_reader :io def initialize(io) @io = io end def puts(*args) io.puts(args) end def puts_red(str) puts_color(31, str) end def puts_green(str) puts_color(32, str) end def puts_yellow(str) puts_color(33, str) end private def puts_color(color_code, str) self.puts "\e[#{color_code}m#{str}\e[0m" end end end
Version data entries
9 entries across 9 versions & 1 rubygems