fcoury / atom-rspec

Atom RSpec runner package
MIT License
69 stars 42 forks source link

Add color support for stdout #104

Open vanboom opened 5 years ago

vanboom commented 5 years ago

I often use the colorize gem with ruby on rails to add color to STDOUT.

puts "some debugging info".yellow

atom-rspec does not colorize the STDOUT, only the rspec results

e.g.

[0;33;49msome debugging info]
vanboom commented 5 years ago

Around line 35 in TextFormatter, this addition works to detect the 256 color mode...

     # replace also 256 color codes
      text = text.replace /\[0;(3[0-7]);([0-9]*)m/, (match, colorCode, other) =>
        "<p class=\"rspec-color tty-#{colorCode}\">"
vanboom commented 3 years ago

Created PR #90 to include this and some other updates.