 #
 # Dependencies:
 #   "underscore": "1.3.3"
-#   "async": "0.2.7"
 #
 # Configuration:
 #   HUBOT_TEAMCITY_USERNAME = <user name>

        configuration = option
        project = null

        buildTypeRE = /^\s*of (.*?) of (.*) (\d*)/i

        buildTypeMatches = option.match buildTypeRE
        if buildTypeMatches?
          configuration = buildTypeMatches[1]
          project = buildTypeMatches[2]
          amount = parseInt(buildTypeMatches[3])
        else
          buildTypeRE = /^\s*of (.*) (\d*)/i
          buildTypeMatches = option.match buildTypeRE
          if buildTypeMatches?
            configuration = buildTypeMatches[1]

#   hubot tc list builds of <buildType> of <project> <number>- Show the status of the last <number> builds of the specified build type of the specified project. Number can only follow the last variable, so if project is not passed, number must follow buildType directly. <number> Defaults to 5
#   hubot tc build start <buildType> - Adds a build to the queue for the specified build type
#   hubot tc build start <buildType> of <project> - Adds a build to the queue for the specified build type of the specified project
#   hubot tc build stop all <buildType> id <buildId> of <project> - Stops all currently running builds of a given buildType. Project parameter is optional. Please note that the special 'all' keyword will kill all currently running builds ignoring all further parameters. hubot tc build stop all all
#
# Author:
#   Micah Martin and Jens Jahnke
#Contributor:
#   Abraham Polishchuk

util           = require 'util'
_              = require 'underscore'

module.exports = (robot) ->
  username = process.env.HUBOT_TEAMCITY_USERNAME
