Releasing Your Inner Unicorn
Tags: lolcat, rubygem, cli, ruby
Published: 2020-01-28 22:33:12

Welcome, readers. Today, I will be showing you all how you can reach deep into your soul and find your rainbow.

Recently, a friend and I developed a simple CLI application that allows users to order coffee using Ruby. It performed simple CRUD actions that are able to take in user input. Let’s sidetrack for a second, CRUD stands for <em>Create</em>, <em>Read</em>, <em>Update</em> and <em>Delete</em>, and is the life of coding.

I was amazed at what we had created! Our application was able to perform all these methods (shoutout to Julz)! Now, what bothered me was how plain and boring it looked. Well, it <em>is</em> a CLI app what else would you expect, is what you might be thinking but coming from a design background: I did not like it at all. So I embarked on a journey to find a way to add a wow factor to our CLI app. After many quests, and article after article about the colorize gem, I read about a 'unicorn'. That's right: a unicorn - or a Ruby Gem called 'LOLCAT'.

Now what this gem does is that it prints out your whole terminal in a rainbow-like so:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ds65mh15kwupim2vaaxh.png)

If you want your terminal to spit out all its info in color simply follow the following steps:

<h4>Using LOLCAT directly in the command line.</h4>

1. Open up your terminal.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0vtq0gd2gwxagg3yvs5u.gif)

2. Type in <em>'gem install lolcat'</em>.

3. Once installed simply add <em>'| lolcat'</em> after a command.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4z62v5of7h8krx8cyh0g.png)

4. Now you can add a splash of color in your dark dark terminal life.

![Alt Text](https://media.giphy.com/media/gx54W1mSpeYMg/giphy.gif)

<h4>Using LOLCAT within a program.</h4>

Now if you want to use this within a program simply do the following:

1. First, create a method (or don't if you don't want to...). 
2. Then, write <em> fork{ } </em>. This allows you to run the lolcat command in the program itself.
3. Finally, Within the <em>{ }</em> add whichever file or method you want to call lolcat on. like so:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/69emaq28cgvyshhc1sk2.png)

The code above created the following results:
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1gevzkdct31e3d8224d0.png)

I have mentioned fork but you might be asking yourself what the <em>-a</em> and <em>-d</em> stand for? In this specific piece of code, we wanted our title screen to be animated so -a stands for animate and -d stands for the duration. The title is now an animation that runs for 4 seconds.

This was able to help me add a few <em>gems</em> to the project (pun intended) and make it sparkle.

If you're still a bit iffy about how to lolcat feel free to check out their GitHub link [here](https://github.com/busyloop/lolcat), but what helped me the most was [this](https://medium.com/@dekadekadeka/lolcat-rainbow-animation-in-ruby-f199bd817e75>) article written by Deka Ambia. I definitely recommend reading this once if you want to use lolcat within your program. 

![Alt Text](https://media.giphy.com/media/Qa3PEDFV4M4eI/source.gif)

Thanks for reading!