Removing extraneous things from Adaptor/Driver

This commit is contained in:
deadprogram 2013-12-15 19:28:12 -08:00
parent c83ce83788
commit ed50c385c4
8 changed files with 16 additions and 12 deletions

1
dist/driver.js vendored
View File

@ -28,6 +28,7 @@
this.self = this;
this.name = opts.name;
this.device = opts.device;
this.connection = this.device.connection;
}
Driver.prototype.start = function(callback) {

View File

@ -29,11 +29,13 @@
};
namespace('Cylon.Adaptors', function() {
var _ref;
return this.Loopback = (function(_super) {
__extends(Loopback, _super);
function Loopback(opts) {
Loopback.__super__.constructor.apply(this, arguments);
function Loopback() {
_ref = Loopback.__super__.constructor.apply(this, arguments);
return _ref;
}
Loopback.prototype.commands = function() {

6
dist/test/ping.js vendored
View File

@ -29,11 +29,13 @@
};
namespace('Cylon.Drivers', function() {
var _ref;
return this.Ping = (function(_super) {
__extends(Ping, _super);
function Ping(opts) {
Ping.__super__.constructor.apply(this, arguments);
function Ping() {
_ref = Ping.__super__.constructor.apply(this, arguments);
return _ref;
}
Ping.prototype.commands = function() {

View File

@ -18,6 +18,7 @@ namespace 'Cylon.Drivers', ->
@self = this
@name = opts.name
@device = opts.device
@connection = @device.connection
start: (callback) ->
Logger.info "Driver #{@name} started"

View File

@ -16,8 +16,5 @@ module.exports =
namespace 'Cylon.Adaptors', ->
class @Loopback extends Cylon.Adaptors.Adaptor
constructor: (opts) ->
super
commands: ->
['ping']

View File

@ -16,9 +16,6 @@ module.exports =
namespace 'Cylon.Drivers', ->
class @Ping extends Cylon.Drivers.Driver
constructor: (opts) ->
super
commands: ->
['ping']

View File

@ -14,7 +14,11 @@
name: 'me'
});
driver = new Cylon.Drivers.Ping({
name: 'driving'
name: 'driving',
device: {
connection: 'connect',
pin: 13
}
});
initDriver = sinon.stub(robot, 'initDriver').returns(driver);
device = new Cylon.Device({

View File

@ -7,7 +7,7 @@ source "test/ping"
describe "Device", ->
robot = new Cylon.Robot(name: 'me')
driver = new Cylon.Drivers.Ping(name: 'driving')
driver = new Cylon.Drivers.Ping(name: 'driving', device: {connection: 'connect', pin: 13})
initDriver = sinon.stub(robot, 'initDriver').returns(driver)
device = new Cylon.Device(name: "devisive", driver: 'driving', robot: robot)