john-griffin/jenkins-client — pull request #2 by dblock (2012-04-26 17:05:56+00:00)
Title: Refactored from singleton and added first class models for job and build

I want to propose a substantial change to the structure of the gem. If you like it, would love if you merged it. If you don't like it, I'll be happy to release the fork under a new name. No hard feelings :)

The biggest gripe is that it's a singleton. There's no need to have one global connection to Jenkins for the entire program, you should be able to use the client against multiple jenkins servers for starters and with multiple authentications.

The second issue is that jobs and builds aren't encapsulated. So adding functionality to a "job" or a "build" becomes difficult. Refactored the code to have a Job and a Build class with their respective methods such as `start!`.

Added a couple of pieces that I need for my project, notably console output from the last failed/succeeded build.