Project

colrou

0.0
No commit activity in last 3 years
No release in over 3 years
Colorize `rails routes` output and insert line breaks between controllers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 13
 Project Readme

Gem Version License Last Commit

Colrou

Colrou reformats output of rails routes. The name is a portmanteau of "colorized routes".

Example

Example

Installation

gem install colrou

The colrou command operates on the output of the rails routes command.

It performs two operations:

  • HTTP verbs and path parameters are colorized
  • Line breaks are inserted between controllers

Usage examples

$ rails routes | colrou

$ rails routes -g posts | colrou

Color configuration

Place a file called .colrou.yml in your home directory (e.g. ~ on Unix) to configure output colors:

http_verb_colors:
  delete: "\e[91m"
  get: "\e[92m"
  patch: "\e[95m"
  post: "\e[93m"
  put: "\e[95m"
misc_colors:
  reset: "\e[0m"
  param: "\e[96m"

See here for a nice overview of shell color codes.

Tip

Add the following lines to e.g. ~/.bash_profile (the location depends on your shell and OS):

alias rr='rails routes'
alias cr='colrou'

You now only have to type $ rr | cr to colorize your routes.