     ko.computed args...
 
 
+
+class LogOutput extends Base
+  constructor: (json) ->
+    super json
+
+
 class ActionLog extends Base
   constructor: (json) ->
+    json.out = (new LogOutput(j) for j in json.out) if json.out
     super json,
       timedout: null
       exit_code: 0

      result

    @action_log_style = @komp =>
      minimize: => @success

    @duration = @komp () =>
      Circle.time.pretty_duration_short(@run_time_millis())



#TODO: next step is to add the vcs_url, which is why I was looking at the knockout.model and knockout.mapping plugin
class Build extends Base
  constructor: (json) ->
    # make the actionlogs observable
    json.action_logs = ko.observableArray( (new ActionLog(j) for j in json.action_logs) )
    super json,
      committer_email: null,
      committer_name: null,
      body: null,
      subject: null

    @url = @komp =>
      "#{@project_path()}/#{@build_num()}"


  constructor: (json, defaults = {}) ->
    for k,v of defaults
      @[k] = @observable(v)

    for k,v of json
      @[k] = @observable(v)

  observable: (obj) ->
    if $.isArray obj
      ko.observableArray obj
    else
      ko.observable obj

  project_name: =>
    @vcs_url().substring(19)
