'#CLI Data Gem Portfolio Project-Triathlon Race'.

Posted by Cheryl K. on November 19, 2018

This is a Ruby project in fulfillment of my first of five projects for my portfolio for Flatiron School. It is called “CLI Data Gem Portfolio Project” and entails building a Ruby gem that provides a Command Line Interface (CLI) to an external data source. According to the project details, the CLI will be composed of an Object Oriented Ruby application. While the project also states that we students will use all we’ve learned about Ruby and CLI Applications in Ruby to complete this project, my approach is to keep it simple and lean by not getting mired by unnecessary complexity.

I chose https://www.teamusa.org/usa-triathlon. It was amenable to scraping, and was relatively static in comparison to sites like https://www.meh.com and https://dailydeal featured in Flatiron School’s video. The user would be seeking information about a triathlon race.

Project Management: I first planned and organized my project:

  • Researched and reviewed lessons on scraping, advanced class methods, modules, binding pry, OO Ruby
  • Laid out file system structure
  • Determined organization and process flow
  • Built classes (CLI, Scraper, Races)
  • Built methods with “def” and “end” only
  • Studied “Worlds 50 Greatest Restaurants”on Github- upheld as exemplary by Flatiron

The difficulties as a coding novice were two-fold: mechanical and academic. The mechanical issues were time consuming but slight: 1) Changing to IDE Download at the suggestion of a Technical Coach 2) The initial Github set up. Github’s site and Stack Overflow yielded a wealth of information. After sifting through them and setting up the repository correctly, I frequently did this sequence: command + s, git status, git add . or git add , git commit -m "update information here", git push. The academic challenges ran deeper. Understanding the interplay between things like requirements/dependencies, the bin and the classes was both problematic and deeply perplexing. Understanding how the methods needed to be constructed in order to elicit the correct returns created non-sensical gibberish code. Consultations with my peers and assigned coaches, reviewing others' code, revisiting lessons, and much Googling helped in refactoring the code.