Week 4: Oracle of Bacon and other stuff19 Jan 2015
This week, I started my SaaS Part 2 class... I decided to just do the SaaS homework in place of my weekly app. The homework involves the Oracle of Bacon website, where you can find the Bacon Number of any actor. It also shows you the linkages along the way... for instance:
Sean Connery was in Der Name der Rose with Ron Perlman who was in Balto with Kevin Bacon.So Sean Connery has a Bacon Number of 2. The website also has an API. You can ask it for a connection between any two actors, and it will return that information (if any) in XML format.
Our job was to connect to the API and write a wrapper around the XML that gets returned. Our wrapper would basically detect if the returned value was valid, and if so, it would make it into an object that we can query. The SaaS class (both part 1 and part 2) has been really good at stressing agile practices, and this homework was no different. We were to pair program over Google Hangouts on Air. The tests were written for us in this assignment, but we needed to get them to pass.
- writing an abstraction layer / wrapper
- handling XML with nokogiri
- writing my own validation method (our class included ActiveModel's Validation methods, so it got a lot of behavior for free)
I finished early so I started on homework 2, which is all about refactoring and working with legacy code. We have to clone an existing repo, the Typo blogging platform and fix a bug in it, but first we have to write tests around the bug. Here's a Google Hangout video of me trying to work out the first part:
I was really confused about half an hour in because I had made some changes and my tests passed, and I was really happy with it. But then all of a sudden all the tests failed even though I hadn't changed anything since the last time! I finally figured out that I had to run bundle exec rake db:test:prepare. Although I still don't understand why... I hadn't changed the database at all since the last time I ran the tests. I thought I only had to run that command when I changed the database.
Level UP Rails is a project designed to give a common baseline to engineers on the Rails Prime stack. It was designed by Joseph Mastey to help onboard new hires to the Enova team. But guess what? It's also open source, so I'm taking it even though Enova hasn't offered me a job yet (what are they waiting for? Fools!). So far I've finished the first lesson of the first course, which mostly focuses on server commands and borderline sysadmin skills, many of which have intimidated me in the past. I just started on the second section entitled 'Basic Ruby'. The overall course description is: "Learn to build and test a complete Ruby on Rails application. This isn't a basic intro: you will finish with some serious ruby chops." I can't wait to have serious chops! I'm documenting my progress on github.
And ... and ... and ... I went to a Ruby Meetup on Wednesday (the featured talk was on Angular JS). I met a lot of nice people. And then I got home just in time to participate in #CodeNewbie Twitter Chat! I didn't feel like I did that much this week, but I guess I did!