DEV Community

Theodore Hoover
Theodore Hoover

Posted on

My First Ruby Gem

Over the past week I built my first CLI application, Solar System Weather. Solar System Weather gives you the current weather data for a location on earth, and then compares that information to another planet in our solar system. I learned a few things building it, and some other things I already learned were reinforced.
What did I learn?

  1. Start out on your local environment I ran into some minor problems by starting on GitHub. It seems that for a ruby gem like this I would have been better off starting by setting up the structure of my gem locally. Going back and forth from my local environment to git and reorganizing and deleting directories and files was a bit of a headache that would have been easy to avoid, especially if I had thought more about how my application would be structured.
  2. It’s usually a simple problem A few times while building Solar System Weather I ran into errors I found difficult to fix. The issue that might have stumped me for the longest time was one where I was not getting any error. I had a line in one of my classes that was holding up the program, and not giving me any error message. puts gets I don’t know what I put that line in for but it was difficult to find. After some frustration I found the line by inserting some binding.pry lines in various spots to see if I would hit them. The lesson here is to look for the simple error first, and to have a methodology for fixing problems.
  3. Someone else might have done the work for you. One of the biggest short comings of Solar System Weather is where the solar system information comes from. The first thing I would do to improve this program is use a scrapper to collect the facts from somewhere on the internet, instead of having them hardcoded into the program. This could add a lot of variety and depth to the application. The only downside of doing this would be the additional reliance on someone else’s site, but for something like this that isn’t a big issue.

Top comments (0)