 # Description:
 #   Kira Caffienation Support Tools
+#
+# Dependencies:
+#    "dateformat": "1.0.x"
 #
 # Commands:
 #   hubot coffee [cups] - What you need to make [cups] cups of coffee.


    teamNotify = brewing.dibs.length < dibsLimit

    claims = []
    for i in [1..dibsLimit]
      claims.push if (dibber = brewing.dibs[i-1])

      else
        "Unclaimed!"

    threadMsg = threadedMsg(msg)
    threadMsg.send "#{if teamNotify then '@team: ' else ''}Fresh Pot!!! #{msg.random freshPots} " +
      ":coffee: Claims (valid until #{dateformat expiry, 'h:MM:ss tt'}):\n" +
      (" • ##{(parseInt index)+1}: #{claim}" for index, claim of claims).join("\n")


    if claims.length
      setTimeout ->
        threadMsg.send "Claims have expired!"
      , dibsDuration*1000

    brewing = {}

