             return done err, '' unless body and body.length
             done err, body[0].state
 
-  register 'pullRequest',
+  github.register 'pullRequest',
     cache: 'repository'
     expire: 300
     update: (done) ->

      options.qs.access_token = token
      request options, done

  register 'ci',
    cache: 'repository'
    expire: 300
    update: (done) ->

impromptu = require 'impromptu'
git = require 'impromptu-git'

async = require 'async'
read = require 'read'
request = require 'request'

module.exports = impromptu.plugin.create (github) ->
  rGitHubUrl = /^(?:git@github.com:|https:\/\/github.com\/)([^\/]+)\/([^\/]+)\.git/

  github.register '_parseRemoteUrl',
    update: (done) ->
      git.remoteUrl (err, url) ->
        return done err if err
