This post regarding the WeWorkRemotely Ruby CLI Gem I created is the first blog post (of many, I’m sure) that has to do with me in the Learn-Verified Web Development Track. While this project took far too long for me to complete, that feeling of having a published gem on RubyGems.org is pretty cool.
What to Make?
During the process of narrowing in on what I wanted to do for my first Ruby CLI gem, I probably changed my mind five times. Once I thought I narrowed it down, I got started by imitating one of the examples listed. The problem I ran into is I picked a website that constantly loads data using AJAX. This created obstacles that I’m not able to over at this point in the program. So, I did what I’ve been taught to do in business – I pivoted.
After realizing this, I switched out my gem idea and found a site that would allow me to scrape it without having to worry about data being constantly updated.
HTML or RSS?
Once I decided to base myWeWorkRemotely Ruby CLI Gem on the WeWorkRemotely website, I had a choice to make: HTML or RSS? The site’s HTML would be hella easy to scrape, but it would require me to scrape two pages in order to get full details on each job posting. The other option, RSS, held all the pertinent information in one location. The obvious choice is RSS after all – why would I make two requests when I can make one?
Tools to Use?
The obvious tools I would use for scraping the information was nokogiri and open-uri. Also, looking at the RSS feed, I could tell I would need something to sanitize the job descriptions because they all contain the HTML used on the site. For this, I decided on rails-html-sanitizer; even though I’m not building a rails application, this worked just groovy.
Now How’d I Do That?
After much time and prayer, I was finally blessed with a working WeWorkRemotely Ruby CLI Gem. The problem you ask? Every time I tried to install it on another machine other than my MacBook, or on a different version of Ruby, it would cause errors. So, I spent about 20 hours debugging and troubleshooting until I finally got it to install and work correctly.
Even now I’m not sure why what I did was wrong other than the way I was utilizing require_relative just wasn’t allowing it to work correctly. I will never know, but at least it works now.
The Walkthrough of My WeWorkRemotely Ruby CLI Gem
If you’re still with me, your reward is a video walkthrough of my newly published gem which can be found by going to the RubyGems.org site and searching for WeWorkRemotely (or by clicking that link). You can also just install it by opening terminal and typing
gem install weworkremotely.