DEV Community

Cover image for Of Course I Need Fun Routes! 🌈
Anna Villarreal
Anna Villarreal

Posted on

6 1

Of Course I Need Fun Routes! 🌈

*general excitement*


Another one of my little tangent side quests here. I'll admit I had to do a little digging to figure this one out. It has no real purpose other than it's awesome and I had fun doing it. You may like it too.

When you run rails routes, you get a swath of white text in your terminal that isn't all that fun to look at. Additionally, it often will run on to the next line and it's a little haphazard feeling unless you zoom way out and then make your terminal gigantic. Can't have that. It has to be fun. (Or you know, stylized to your taste, 10 shades of whatever your brand is.) XD

Turn this:

regular routes

Into this:

fun routes

So I messed around a bit...

colored lines

Ok, things are happening. You can easily add structure by calling rails routes --expanded

expanded rainbow routes

Now were cooking with fire.

If this can be done, it means I can break it apart and put colors in places I want them. Excellent.

Lets take one part of the route, lets say the path for example. We can make a color array to loop over the characters.

rainbow paths

This is totally my vibe.


But can it be useful?

How about we highlight the verbs and slap the controller below it so it's not so squished in the terminal.

excellent routes

Now we can find the routes a bit easier with verb highlighting. Perf.

The point here is, you can tweak it, and it can be sort of helpful.

If you are interested in poking around with this, my rake file can be found here: Rainbow Routes

Thanks for looking!

I'd like to hear everyones 2 cents on the matter. Does anyone else do this? 🀣

Image of Timescale

πŸš€ pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applicationsβ€”without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more β†’

Top comments (2)

Collapse
 
bibimbop123 profile image
Brian Kim β€’

Not gonna lie I did find that pretty cool! Thanks for sharing Anna!

Collapse
 
annavi11arrea1 profile image
Anna Villarreal β€’

Thanks!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay