Skip to content

Instantly share code, notes, and snippets.

@atmos
Created February 15, 2011 07:30
Show Gist options
  • Save atmos/827231 to your computer and use it in GitHub Desktop.
Save atmos/827231 to your computer and use it in GitHub Desktop.
Job.prototype.branches_for = function(branch, callback) {
var self;
self = this;
this.builds(function(err, data) {
var hash, numbers;
numbers = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = data.length; _i < _len; _i++) {
hash = data[_i];
_results.push(hash.number);
}
return _results;
})();
console.log(numbers);
return Map(numbers, self.build_for, function(err, results) {
var branches;
branches = new Branch(me.job, branch, results);
return callback(branches);
});
});
return this.client.fetch("/job/" + this.name + "/" + number + "/api/json", function(err, data) {
var build;
build = new Build(host, name, number, data);
return callback(err, build);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment