This is my first ruby gem. It simply lists new DVD and streaming releases in a CLI with options to view more information about particular releases.
I had no previous exposure to gem building and was a tad immobilized at first. Lucky for me and fellow ruby learners, I found several great resources to guide and hand-hold along the way.
My biggest hold up was getting my brain around data distribution from third party sites. The requirement of this assignment was to scrape a webpage data using Nokogiri. I started off that route but found that the movie data was dynamically generated and wasn’t scraping. I was getting empty elements.
After some quick research I found Watir WebDrive could help grab dynamically generated data. But it had to do it by opening a browser instance. Since this doesn’t make for great UX, not to mention defeats the purpose of making command line gem, I was back to square one. After some more digging, I read that the best option most of the time is to inspect the page to grab the data feed’s url. That’s what I ended up doing. It admittedly took me a long time to find it, as the page loaded a great deal of scripts.
For next time/things I learned: Make sure the data is accessible and ready to use before starting. I wasted a lot of time setting up everything thinking the data would be just fine. It worked in the end, but not seamlessly as I first thought.
Here’s a quick walkthrough: