           user: results[1]
           repo: results[2]
 
-  register 'isGitHub',
+  github.register 'isGitHub',
     update: (done) ->
       github._parseRemoteUrl (err, results) ->
         done err, !!results
 
-  register 'remoteUser',
+  github.register 'remoteUser',
     update: (done) ->
       github._parseRemoteUrl (err, results) ->
         done err, results?.user
 
-  register 'remoteRepo',
+  github.register 'remoteRepo',
     update: (done) ->
       github._parseRemoteUrl (err, results) ->
         done err, results?.repo
 
-  register 'token',
+  github.register 'token',
     update: (done) ->
       process.env.IMPROMPTU_GITHUB_TOKEN
 

            return done err, '' unless body and body.length
            done err, body[0].state

  register 'pullRequest',
    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
