class Minitest::RG
Constants
- COLORS
- VERSION
Attributes
colors[R]
io[R]
Public Class Methods
new(io, colors = COLORS)
click to toggle source
# File lib/maxitest/vendor/rg.rb, line 66 def initialize io, colors = COLORS @io = io @colors = colors end
rg!(bool = true)
click to toggle source
# File lib/maxitest/vendor/rg.rb, line 58 def self.rg!(bool = true) @rg = bool end
rg?()
click to toggle source
# File lib/maxitest/vendor/rg.rb, line 62 def self.rg? @rg ||= false end
Public Instance Methods
method_missing(msg, *args)
click to toggle source
Calls superclass method
# File lib/maxitest/vendor/rg.rb, line 88 def method_missing msg, *args return super unless io.respond_to? msg io.send(msg, *args) end
print(o)
click to toggle source
# File lib/maxitest/vendor/rg.rb, line 71 def print o io.print(colors[o] || o) end
puts(o = nil)
click to toggle source
# File lib/maxitest/vendor/rg.rb, line 75 def puts o = nil return io.puts if o.nil? if o =~ /(\d+) failures, (\d+) errors/ if Regexp.last_match[1] != "0" || Regexp.last_match[2] != "0" io.puts "\e[31m#{o}\e[0m" else io.puts "\e[32m#{o}\e[0m" end else io.puts o end end