john-griffin/jenkins-client — pull request #4 by dblock (2012-04-30 13:58:31+00:00)
Title: Refactored models to avoid job or client assignment, connections and spec work.

Two things bothered me in my initial implementation, fixed in this pull request.

Direct assignment of job to build and of client to job. You can't override `super` because Rash is an amazing implementation that does that for you, breaking every single thing you ever knew about OOP :) But, you can pass another rash/hash to rash and it just assigns those as fields. So instead of assigning job or client, pass those in the constructor part of the hash.

Multiple connection methods, one for a raw connection and another for a json connection. Made connection accept a series of options and generating a key for those options, storing the connection in a hash. This way we can extend it further when we need some other kind of connection. This is a lot less code. I also sunk the connection inside Client so this is now an internal implementation detail.

Moved fixture json data into support/fixtures.

Added specs for Jenkins::Client::Build.