Make even shorter syntax by removing redundant Adaptors and Drivers
This commit is contained in:
parent
ed50c385c4
commit
6c1e591f84
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
require('./basestar');
|
require('./basestar');
|
||||||
|
|
||||||
namespace('Cylon.Adaptors', function() {
|
namespace('Cylon', function() {
|
||||||
return this.Adaptor = (function(_super) {
|
return this.Adaptor = (function(_super) {
|
||||||
__extends(Adaptor, _super);
|
__extends(Adaptor, _super);
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
require('./basestar');
|
require('./basestar');
|
||||||
|
|
||||||
namespace('Cylon.Drivers', function() {
|
namespace('Cylon', function() {
|
||||||
return this.Driver = (function(_super) {
|
return this.Driver = (function(_super) {
|
||||||
__extends(Driver, _super);
|
__extends(Driver, _super);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
return Loopback;
|
return Loopback;
|
||||||
|
|
||||||
})(Cylon.Adaptors.Adaptor);
|
})(Cylon.Adaptor);
|
||||||
});
|
});
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
return Ping;
|
return Ping;
|
||||||
|
|
||||||
})(Cylon.Drivers.Driver);
|
})(Cylon.Driver);
|
||||||
});
|
});
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace = require 'node-namespace'
|
||||||
|
|
||||||
require './basestar'
|
require './basestar'
|
||||||
|
|
||||||
namespace 'Cylon.Adaptors', ->
|
namespace 'Cylon', ->
|
||||||
class @Adaptor extends Cylon.Basestar
|
class @Adaptor extends Cylon.Basestar
|
||||||
constructor: (opts={}) ->
|
constructor: (opts={}) ->
|
||||||
@self = this
|
@self = this
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace = require 'node-namespace'
|
||||||
|
|
||||||
require './basestar'
|
require './basestar'
|
||||||
|
|
||||||
namespace 'Cylon.Drivers', ->
|
namespace 'Cylon', ->
|
||||||
class @Driver extends Cylon.Basestar
|
class @Driver extends Cylon.Basestar
|
||||||
constructor: (opts={}) ->
|
constructor: (opts={}) ->
|
||||||
@self = this
|
@self = this
|
||||||
|
|
|
@ -15,6 +15,6 @@ module.exports =
|
||||||
new Cylon.Adaptors.Loopback(args...)
|
new Cylon.Adaptors.Loopback(args...)
|
||||||
|
|
||||||
namespace 'Cylon.Adaptors', ->
|
namespace 'Cylon.Adaptors', ->
|
||||||
class @Loopback extends Cylon.Adaptors.Adaptor
|
class @Loopback extends Cylon.Adaptor
|
||||||
commands: ->
|
commands: ->
|
||||||
['ping']
|
['ping']
|
||||||
|
|
|
@ -15,7 +15,7 @@ module.exports =
|
||||||
new Cylon.Drivers.Ping(args...)
|
new Cylon.Drivers.Ping(args...)
|
||||||
|
|
||||||
namespace 'Cylon.Drivers', ->
|
namespace 'Cylon.Drivers', ->
|
||||||
class @Ping extends Cylon.Drivers.Driver
|
class @Ping extends Cylon.Driver
|
||||||
commands: ->
|
commands: ->
|
||||||
['ping']
|
['ping']
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
describe("Adaptor", function() {
|
describe("Adaptor", function() {
|
||||||
var adaptor;
|
var adaptor;
|
||||||
adaptor = new Cylon.Adaptors.Adaptor({
|
adaptor = new Cylon.Adaptor({
|
||||||
name: 'adapt'
|
name: 'adapt'
|
||||||
});
|
});
|
||||||
return it('needs tests');
|
return it('needs tests');
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
describe("Driver", function() {
|
describe("Driver", function() {
|
||||||
var driver;
|
var driver;
|
||||||
driver = new Cylon.Drivers.Driver({
|
driver = new Cylon.Driver({
|
||||||
name: 'max',
|
name: 'max',
|
||||||
device: {
|
device: {
|
||||||
connection: 'connect',
|
connection: 'connect',
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
source "adaptor"
|
source "adaptor"
|
||||||
|
|
||||||
describe "Adaptor", ->
|
describe "Adaptor", ->
|
||||||
adaptor = new Cylon.Adaptors.Adaptor(name: 'adapt')
|
adaptor = new Cylon.Adaptor(name: 'adapt')
|
||||||
|
|
||||||
it 'needs tests'
|
it 'needs tests'
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
source "driver"
|
source "driver"
|
||||||
|
|
||||||
describe "Driver", ->
|
describe "Driver", ->
|
||||||
driver = new Cylon.Drivers.Driver(name: 'max', device: {connection: 'connect', pin: 13})
|
driver = new Cylon.Driver(name: 'max', device: {connection: 'connect', pin: 13})
|
||||||
|
|
||||||
it 'needs tests'
|
it 'needs tests'
|
||||||
|
|
Loading…
Reference in New Issue