         @failing.splice index, 1 if index isnt -1
 
 module.exports = (robot) ->
-  notifier = new JenkinsNotifier robot
+  robot.jenkins_notifier = new JenkinsNotifier robot
 
   robot.router.post "/hubot/jenkins-notify", (req, res) ->
-    notifier.process req, res
+    robot.jenkins_notifier.process req, res
 

    try
      # Newer versions of express/hubot already process posts that have Content-Type application/json
      for key of req.body
        data = JSON.parse key
    catch error
      try
        data = req.body
      catch error
        @error error
        return

    if data.build.phase == 'FINISHED'
      if data.build.status == 'FAILURE'


url = require('url')
querystring = require('querystring')
util = require('util')


class JenkinsNotifier
