Fix issues with registerAdaptor

This commit is contained in:
Andrew Stewart 2013-10-23 15:12:53 -07:00
parent 61e8c776c3
commit 2c34f4c77e
1 changed files with 6 additions and 3 deletions

View File

@ -79,13 +79,16 @@ module.exports = class Robot
return @adaptors[adaptorName]
requireAdaptor: (adaptorName, connection) ->
self.requireAdaptor(adaptorName, connection)
requireAdaptor: (args...) ->
self.requireAdaptor(args...)
registerAdaptor: (moduleName, adaptorName) ->
@registerAdaptor: (moduleName, adaptorName) ->
return if self.adaptors[adaptorName]?
self.adaptors[adaptorName] = moduleName
registerAdaptor: (args...) ->
self.registerAdaptor(args...)
requireDriver: (driverName, device) =>
require("cylon-#{@drivers[driverName]}").register(this) unless @drivers[driverName]?
require(@drivers[driverName]).driver(driverName)(device: device)