Commit Graph

11 Commits

Author SHA1 Message Date
André Cordeiro d550df34f8 test-adaptor.js - Adding superclass methods
Adding the connect and disconnect methods for the TestAdaptor can be used for tests otherwise an exception will be thrown.
Exception: Adaptor#connect method must be overwritten by descendant classes.
2016-07-26 14:16:57 -03:00
Andrew Stewart 0b48851885 Remove unnecessary comments at start of files 2015-06-22 09:16:43 -07:00
Andrew Stewart ad2db2d459 Update ESLint, use local for make tasks 2015-06-11 12:16:43 -07:00
Andrew Stewart cccb376679 Consistent top-of-file doc blocks 2015-04-15 08:59:12 -07:00
Andrew Stewart eccdde81a9 Update copyright years 2015-01-07 12:58:50 -08:00
Andrew Stewart ac6b09fe50 Clean up lib for JSHint 2014-12-15 11:15:29 -08:00
Andrew Stewart 44075a1a30 Hook Repository class up, change-up module loading
Cylon modules were previously styled something like this:

    module.exports = {
      adaptor: function(args) {
        return new Adaptor(args);
      },

      register: function(robot) {
        Cylon.Logger.debug("Registering Firmata adaptor for " + robot.name);
        robot.registerAdaptor('cylon-firmata', 'firmata');

        GPIO.register(robot);
        I2C.register(robot);
      }
    };

Now, they should be something more like this:

    module.exports = {
      adaptors: ['firmata'],
      dependencies: ['cylon-gpio', 'cylon-i2c'],

      adaptor: function(args) {
        return new Adaptor(args);
      },
    };
2014-10-30 13:29:06 -07:00
Andrew Stewart f91dd7d5c3 Refactor Utils (mostly) out of global namespace
This commit reframes the Utils module to be more self-contained, and now only
the Number prototype methods and the every/after/constantly methods are exposed
globally.

I'm unsure about whether these methods can be more scoped such that people can
turn them off if they want, but that's potentially something to look into in the
future.

This commit also updates most of the other source files in Cylon, requiring the
Utils module rather than assuming the methods are in the global namespace.

A similar batch of commits will need to be made for all other Cylon modules to
make sure they don't explode when they can't find #subclass or something like
that.

To make the previously-global methods available, both in submodules and for
people looking for them, all the utility functions are exported in Cylon.Utils.
2014-06-05 12:17:29 -07:00
Andrew Stewart d46de63379 Remove node-namespace from Test Drivers/Adaptors 2014-05-06 18:56:13 -07:00
Andrew Stewart 637bce0e6d Remove node-namespace from Adaptor 2014-05-06 18:19:56 -07:00
deadprogram b27756abfc WIP on pure JS revamp 2014-02-27 06:44:53 -08:00