pry/pry — Issue #407: "highlight" command to highlight Ruby code
Author: korny
Created: 2012-01-05 10:50:55+00:00
State: open

So, here's my first feature request for the awesome Pry tool.

When I have some Ruby code in a variable (eg., a Prawn template in Rails), it would be great to use Pry's ability to highlight Ruby code for printing/inspecting it.

Right now, I have to do something like:

puts Pry::Helpers::BaseHelpers.colorize_code template.source

I would propose a new command to simplify this:

highlight template.source

This should probably ignore the "colorize" setting, since I'm explicitly saying that it should colorize the code.

As for the name, I think "syntax-highlight" is too long. "colorize" might be an alternative.