Bob Nadler, Jr. Bob Nadler, Jr.

GitScore Part 1

Published almost 9 years ago 1 min read
Scoreboard
Image by tyosshiman

UPDATE: Parts 2 & 3 are now done.

Recently I've been playing around with Screenflow, creating screencasts illustrating how I build Sinatra applications in Ruby. My goal was to create a few well-polished screencasts, but finding the time is hard. In addition, since my video editing ability is not quite there yet, it takes me a long time. In the interest of getting something out there for people to look at, I'm going to release a few short screencasts that have not been highly edited, so you'll get to see my mistakes.

For this first set of screencasts, the idea came from watching a Peepcode Play by Play. The goal is to create an app that "scores" GitHub activity. The basic premise is to request a user's public activity, and then based on the events in the timeline, assign a score to each. For example, a "WatchEvent" occurs when a user watches a repository. It is worth one point.

I'm not going to go into much detail about how I implemented a solution, but I do want to give you a bit more context that I did not put into the video. First, I'm using Hoboken to generate the Sinatra application skeleton. Hoboken is another project that I've been working on that generates Sinatra applications. I haven't released an official version yet, but I've been using for a few of my own projects for a few months now. Check out its README for more info. I'll write another post going into detail about it soon.

I also used this project to explore the idea of the Ports and Adapters pattern. In the video I show how I create an adapter for the GitHub data. The screencast also shows leveraging Sinatra's settings feature to inject the GitHub adapter.

Part one of this series shows how I set up the project and get a minimal round trip implementation set up that queries GitHub and shows something on the page. Later this week I'll put up the next videos that show the scoring implementation. I hope you enjoy it!


Share This Article