https://github.com/evaneykelen/colrou
Colorize `rails routes` output and insert line breaks between controllers
https://github.com/evaneykelen/colrou
rails routes ruby
Last synced: about 1 year ago
JSON representation
Colorize `rails routes` output and insert line breaks between controllers
- Host: GitHub
- URL: https://github.com/evaneykelen/colrou
- Owner: evaneykelen
- License: mit
- Created: 2019-03-09T15:55:39.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-28T08:14:58.000Z (almost 6 years ago)
- Last Synced: 2024-10-11T23:19:27.444Z (over 1 year ago)
- Topics: rails, routes, ruby
- Language: Ruby
- Size: 10.7 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
 

# Colrou
Colrou reformats output of `rails routes`. The name is a portmanteau of "colorized routes".
## 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](https://misc.flogisoft.com/bash/tip_colors_and_formatting) 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.