Commit Graph

36 Commits

Author SHA1 Message Date
Andrew Stewart 3f4140bd08 Add util to verify constructor calls use 'new' 2015-05-12 18:47:27 -07:00
Andrew Stewart cccb376679 Consistent top-of-file doc blocks 2015-04-15 08:59:12 -07:00
Andrew Stewart 82ef3d31a2 Add exploding interface functions for Driver/Adaptor
Explicit is better than implicit, and this causes errors to be more
specific
2015-03-19 17:47:15 -07:00
Andrew Stewart 28415f0b74 Add basic #includes helper for arrays 2015-03-11 12:31:45 -07:00
Andrew Stewart 6e3d7c6667 Add helpers to replace some lodash functionality
Not a 1:1, and probably much slower than Lodash's ultra-optimised
implementations, but we do enough I/O that it's not really relevant,
is it?
2015-02-23 08:38:12 -08:00
Andrew Stewart 618aa8212d Remove lodash 2015-02-20 11:15:34 -08:00
Andrew Stewart eccdde81a9 Update copyright years 2015-01-07 12:58:50 -08:00
Andrew Stewart cf0d24f785 Add API event publication
This update gives Cylon support for the latest changes to the CPPP-IO
spec.
2015-01-05 12:20:53 -08:00
Andrew Stewart b5907ccd36 Correct iteration key issue 2014-12-17 16:36:48 -08:00
Andrew Stewart 6cbf2db122 Lodashify 2014-12-17 14:45:57 -08:00
Andrew Stewart ac6b09fe50 Clean up lib for JSHint 2014-12-15 11:15:29 -08:00
Andrew Stewart e67ae19882 Remove Connection and Device classes
They are now functions that return instances of Adaptors and Drivers
respectively.
2014-11-10 16:06:10 -08:00
Andrew Stewart 75c8d47676 Remove commands array from Adaptor base class 2014-09-29 15:41:13 -07:00
Andrew Stewart 1b549f2dbb Remove Adaptor#_noop function 2014-09-22 09:53:10 -07:00
Andrew Stewart cf643d9d70 Remove default Adaptor#connect and Driver#start methods
Child classes should always implement these themselves.
2014-09-08 09:27:18 -07:00
Andrew Stewart 14d8bbab00 Remove base Adaptor#disconnect and Driver#halt fns
Would be more useful to module developers to loudly error rather than silently
not work.
2014-09-05 09:55:57 -07:00
Andrew Stewart 9fe9700eef Restructure Halt/Disconnect Structure
Moves disconnecting event handlers up a level so adaptors/drivers don't have to
worry about it.

Now, Adaptor/Driver subclasses should simply execute the provided callback to
dindicate they're done disconnecting, rather than calling the superclass method
as before.
2014-09-05 09:38:12 -07:00
Andrew Stewart ee366739d3 Misc. small refactors 2014-07-10 09:51:23 -07:00
Andrew Stewart ca2bf7e5a9 Merge branch 'dev' into servo-level-up
* dev:
  Remove `self` references in favor of #bind
  Stop using #fetch here for now, it just breaks tests
  Just use arguments directly instead of array
  Remove Utils#bind in preference of built-in fn
  Consolidate logstring generation into private fn
  Experiment with Utils.fetch in Driver class
  Add #fetch Utility function
  Fix JSHint errors
  Fix an edge case and improve tests for API
2014-07-03 11:52:02 -07:00
Edgar Silva 1eabab6ec9 WIP: Change noop to use anonymous function and added tests. 2014-07-03 13:42:43 -05:00
Andrew Stewart f0d8b0360b Remove `self` references in favor of #bind 2014-07-03 09:35:24 -07:00
Edgar Silva ed8d6faeee Chance Adaptor#noop for Adaptor#_noop. 2014-07-02 20:06:40 -05:00
Edgar Silva afa7fe7495 Adds noop function to base adaptor. 2014-07-02 19:42:39 -05:00
Andrew Stewart 6de922f2fc Make halting on SIGINT async
This change gives adaptors/drivers more flexibility in halting. Additionally,
now, by default, all Adaptors/Drivers will remove all their event listeners
before halting, which should prevent some additional commands from being sent to
the adaptor during shutdown.
2014-06-12 15:31:49 -07:00
Andrew Stewart 8d3c89076d Allow easier extension in subclasses w/ prototypes 2014-06-10 14:18:35 -07:00
Andrew Stewart 1832e20e17 Expose commands as array, instead of function
For appropriate classes, #commands is now an array, instead of a function that
returns the same array.
2014-06-10 12:29:44 -07:00
Andrew Stewart 9406fddaad Use same formatting for all log strings 2014-06-10 11:33:52 -07:00
Andrew Stewart 0517942253 Remove the 'connect' and 'start' events
These events are being removed, as they're essentially useless in most cases, as
the events will already have been emitted before the work block is run to set up
handlers for them.
2014-06-10 09:20:23 -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 c22ef95239 Remove Logger from global namespace 2014-05-13 19:44:40 -07:00
Andrew Stewart 637bce0e6d Remove node-namespace from Adaptor 2014-05-06 18:19:56 -07:00
Andrew Stewart a9ae09bdce Remove Basestar from global scope 2014-04-24 16:31:58 -06:00
Andrew Stewart 204bf89685 Remove trailing whitespace 2014-02-27 14:14:51 -08:00
deadprogram 3694361eea Add comments to adaptor functions 2014-02-27 11:45:09 -08:00
deadprogram 8b88e5dc10 Refactor adaptor & driver to pure JS style 2014-02-27 09:38:38 -08:00
deadprogram b27756abfc WIP on pure JS revamp 2014-02-27 06:44:53 -08:00