Created
          February 15, 2011 07:30 
        
      - 
      
- 
        Save atmos/827231 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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