Colourize your Ruby output

Folks,

The attached GIF shows a console session where a buggy Ruby program is run
and an exception unceremoniously dumped to STDERR.

The difference is that it's syntax highlighted. Ian Macdonald's 'acoc'
does all the heavy lifting; the following entry in my ~/.acoc.conf does
the rest:

  # Highlight Ruby source files, etc., when there's an exception.
  [ruby/er]
  # message and error class
  /:\d+:in `.*?': (.*) \((.+)\)\s*$/ bold,red+bold
  # file name and line number
  /^(?:\s+from)?(.*?):(\d+)/ green+bold,yellow+bold
  # method name
  /:in `(.*?)'/ cyan+bold

Pretty handy.

'acoc' relies on term-ansicolor and likes to have 'tpty'. I'll try to gem
all these up soon to make them easy to install. I'm sure Mauricio will do
the same for RPA :slight_smile:

Hope this helps, and hope someone will improve it.

Cheers,
Gavin