Commit Graph

899 Commits

Author SHA1 Message Date
deadprogram fbb8a6a192 Correct links to new docs site repo 2014-06-12 19:43:21 -07:00
Ron Evans cc9b06285e Merge pull request #203 from hybridgroup/refactor/halt
Make halting on SIGINT async
2014-06-12 17:22:29 -07:00
Andrew Stewart d90c4eef7c Fix broken specs 2014-06-12 15:40:08 -07: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 a44154b1f4 Change README image source to cylon-site repo 2014-06-12 09:36:58 -07:00
Ron Evans f1c82f6021 Merge pull request #202 from andrew/patch-1
Fixed logo in readme
2014-06-12 07:49:05 -07:00
Andrew Nesbitt 8206ac67af Fixed logo 2014-06-12 15:42:47 +01:00
Ron Evans 613326b902 Merge pull request #201 from hybridgroup/upd-from-scale-util
Updated fromScale util to return top or bottom of scale, updated specs t...
2014-06-11 17:35:03 -04:00
edgarsilva 0869909521 Updated fromScale util to return top or bottom of scale, updated specs to reflect new fromScale behavior. 2014-06-11 16:32:40 -05:00
Andrew Stewart 9e1ffad6f6 Add more tests for BasicLogger class 2014-06-10 19:05:41 -07:00
Andrew Stewart 9bbc7faf5e Misc. JSHint-suggested cleanups in BasicLogger 2014-06-10 18:50:10 -07:00
Andrew Stewart 682bfc6536 Add missing semicolon to appease JSHint 2014-06-10 18:45:08 -07:00
Andrew Stewart f797cf4c48 Misc. cleanup in Basestar 2014-06-10 18:44:40 -07:00
Andrew Stewart 9c60700c0f Clean up declaration of default work block 2014-06-10 18:38:55 -07:00
Andrew Stewart b66a1d3fee Remove unused param for #start callback 2014-06-10 18:38:00 -07:00
Andrew Stewart 594c73dc60 Declare missingModuleError before it's used 2014-06-10 18:37:19 -07:00
Andrew Stewart 3b312def0d Small cleanups in Device 2014-06-10 18:19:04 -07:00
Andrew Stewart 8d3c89076d Allow easier extension in subclasses w/ prototypes 2014-06-10 14:18:35 -07:00
Ron Evans bdf3c24388 Merge pull request #200 from hybridgroup/refactor/commands
Expose commands as array, instead of function
2014-06-10 16:06:19 -04: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
Ron Evans 17c1d4609f Merge pull request #198 from hybridgroup/refactor/robot
Robot Refactors
2014-06-10 13:52:00 -04:00
Ron Evans 2d88470bbe Merge pull request #199 from hybridgroup/remove/events
Remove the 'connect' and 'start' events from Adaptors/Drivers
2014-06-10 12:58:44 -04: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 3672a1b712 General cleanup of single-line statements 2014-06-09 14:02:06 -07:00
Andrew Stewart dd553a55f2 Clean up #start to use Async.series 2014-06-09 13:55:44 -07:00
Andrew Stewart 4e43483e9d Slightly refactor constructor 2014-06-09 13:41:46 -07:00
Andrew Stewart dbde3d5b7d Remove circular reference from Robot 2014-06-09 13:24:42 -07:00
Andrew Stewart b1d7dd8186 Generate BasicLogger methods, rather than duplicating code 2014-06-06 17:09:22 -07:00
Adrian Zankich 08c6b6e3dc Update README.markdown 2014-06-06 15:44:06 -07:00
Ron Evans 3717c4dc31 Merge pull request #195 from hybridgroup/refactor/robots-collection
Refactor Robots collection
2014-06-06 18:36:19 -04:00
Ron Evans de7b352077 Merge pull request #196 from chrisbodhi/patch-1
Update keyboard.markdown
2014-06-06 18:25:10 -04:00
Chris Boette 957ad1790a Update keyboard.markdown
Minor fixes from CoffeeScript to JavaScript.
2014-06-06 17:24:13 -05:00
Ron Evans 836b7938db Merge pull request #191 from hybridgroup/refactor/utils
Refactor Utils (mostly) out of global namespace
2014-06-06 18:21:46 -04:00
Andrew Stewart ebdeeccd12 Use implicit object conversion with #toJSON
JSON.stringify, if told to convert an object with a #toJSON method, will instead
stringify the result of the #toJSON method.
2014-06-06 14:15:43 -07:00
Andrew Stewart af4bbd963b Clean up API implementation using middleware 2014-06-06 13:52:55 -07:00
Andrew Stewart 5690d723fb Update examples that previously used findRobot 2014-06-06 11:53:54 -07:00
Andrew Stewart 81fa260963 Store robots in an dict, rather than array
Also removes the find{Robot,RobotConnection,RobotDevice} methods. Additionally,
stops passing the Master through to the Robot constructor, we can just
require('./cylon') if we need to access anything in there.
2014-06-06 11:36:22 -07:00
Andrew Stewart 2b5e991ef3 Clean up some of the utility functions 2014-06-05 16:30:05 -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 789347f6f8 Improve inline docs for Utils functions 2014-06-05 09:32:20 -07:00
Andrew Stewart a5241e57b5 All work and no play makes Jack a dull boy
Robots can now take a break and have #play functions instead of #work.
Internally they're treated the same, but it's a fun easter egg!

Example:

Cylon.robot({
  name: 'Jack',

  connections: [],
  devices: [],

  play: function play(my) {
    every((5).seconds(), function() {
      console.log("All work and no play makes %s a dull boy.", my.name);
    });
  }
});

I sincerely apologize for the repeated reference to The Shining, blame
@deadprogram.

Closes #189.
2014-06-04 16:33:20 -07:00
Andrew Stewart bc4a1f5cea Remove JSHint/Istanbul from package.json
JSHint is very rarely used, and Istanbul only on Travis to generate coverage
reports for CodeClimate.

So instead of bundling it with Cylon at all times, it will now be installed
globally by Travis prior to running tests.

The Make tasks for JSHint/Istanbul now also assume both packages are installed
globally, rather than in the local node_modules directory.
2014-06-04 16:01:47 -07:00
Andrew Stewart 9b352feeae Move API command param parsing to middleware 2014-06-04 15:54:23 -07:00
Ron Evans 0e019f1151 Merge pull request #190 from hybridgroup/refactor/api
Bump Express version, refactor API
2014-06-04 17:06:46 -04:00
Andrew Stewart 38ad5eae78 Remove unnecessary/broken tests 2014-06-04 13:41:42 -07:00
Andrew Stewart ac0a69e63f Move API routes to their own file 2014-06-04 13:39:30 -07:00
Andrew Stewart 789ce02ad0 Organize server creation into new function 2014-06-04 13:21:15 -07:00
Andrew Stewart a4cfc4b8ec Improve authentication middleware mounting 2014-06-04 13:17:17 -07:00
Andrew Stewart 5e21c52b95 Add mock request/response classes for testing 2014-06-04 12:51:35 -07:00