Refactored from singleton and added first class models for job and build #2

Merged
merged 3 commits into from Apr 27, 2012

Projects

None yet

2 participants

@dblock
Collaborator
dblock commented Apr 26, 2012

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.

@dblock
Collaborator
dblock commented Apr 26, 2012

Btw, this pull also merges @aimak's work, which fixed the URL issue I was having.

@john-griffin
Owner

Thanks for getting this refactored. I had started on something similar but hadn't gotten round to completing it so this is great. I'll merge this is in and do a new release in a few days.

@john-griffin john-griffin merged commit 6664802 into john-griffin:master Apr 27, 2012
@dblock
Collaborator
dblock commented Apr 27, 2012

Awesome. I'll make some more pulls to move this forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment