Everybody loves Ruby < 15 Least Travelled Countries >

Posted by vanitanaidu on January 30, 2017

When I first read the instructions for this project, I remember just staring at the web page for like a minute. I thought, “Wait. I am building an app from scratch? ”

alt text

After that initial thought, I remember just taking a break for 2 full days. I lied to my husband and told him I was doing research but in reality I was freaking out so I decided to watch Netflix instead. Yes, I watched Netflix for 2 full days and ate all the junk I could find in my kitchen. I was stressed out and I was buying time. The 2 days passed and I knew I had to face my fears. So as an ex-counselor, I went into therapy mode. I asked myself “What is your biggest fear about this project?” Followed up with a few more questions, I quickly got to the root problem. I didn’t know how to start. I didn’t know where to start. I was feeling like I had no control over the project. So like I always did, I turned to Google to ease my fears. It was obvious that if I wanted to build an app from scratch, I had to equip myself with the knowledge that I didn’t have and that got me started.

My biggest struggle for this project was creating all the files I needed for an app and organizing them in such a way that there was a flow. My first step was to watch all the different videos provided on the lesson page. I also went on YouTube to watch videos that further explained new concepts like “require vs require relative”, “How to create a gem from scratch”, etc.

After that, I was somewhat ready to start creating my files. I created my first repo on Github. I built my lib and bin folders, ReadMe and spec.md files. I made a lot of changes along the way like renaming, recreating and removing files and it felt messy. However, that worked out to my advantage because the mess I created forced me to learn the very scary Github commands. I’m now a rock star with git commands and I have a better understanding of Github.

The next thing I did was clone the 2 project examples provided in the instructions ‘Now-Playing’ and ‘Worlds Best Restaurants’. I ran both the programs on my local environment and read the code to understand what the developers were doing and what the different methods and classes were returning. Pry was a life-saver. I wonder what programming life was like before Pry.

My biggest takeaway from this project:

Always build a rough user interface first. One you have that mapped out, you get a feel for what methods you need and from there you can get started. Also I learned to look at other people’s code. It felt like cheating at first, or maybe like I wasn’t learning for myself, but I soon realized I was actually learning a lot. I had to analyze their code to make sense of it.

Also, sometimes solving a problem requires thinking out of the box. I got very stuck with my scraping towards the end of my project. The website I was scraping was pretty badly organized. Some information I needed had 2 selectors while some had 3. I was determined to make this work. At some point it struck me that I could actually group the information I needed under 1 heading by using the + string method to add up all the different selectors. It was such a simple solution to what initially seemed like a big problem.
</br>

This was the code I ended up with:

alt text

Now that my project is over, I feel a huge relief because I finally understand how programs and gems work and how classes, instances, and variables work together to create a program. This project gave me the visual understanding I needed. Creating an app from scratch was scary, but now that I’ve completed it, I must say the journey was amazing!

Take a look at my CLI-Data-Gem project Click here