Wednesday, September 12, 2012

Pretty-Printing Ruby as used in Chef


Chef doesn't have meaningful filenames -- override the page's title to make the output more readable.  The below makes two pages of code be printed on a single page of output, so you don't wind up paper pushing too much when reviewing code.

HTML:

enscript --fancy-header --nup=2 -Eruby --color -whtml -pz.html --title='recipes/web' default.rb 

Printer:


enscript --fancy-header --nup=2 -Eruby --color  --title='recipes/web' default.rb 



Print all non-empty files in the Python directory, make pretty like Ruby scripts:

egrep -r . python | awk -F: '/rb:/ {print $1}' | sort -u | xargs enscript --fancy-header --nup=2 -Eruby --color

No comments:

Post a Comment