gabipetrovay/node-orientdb — pull request #18 by ryanfields (2012-03-30 13:51:33+00:00)
Title: Auto-loading commands

As suggested in issues #15 and #16, I've modified manager.js to iterate through the files in the commands directory and require each one. For each module that exports an "operation" property, that module gets added to a commands hash. (This allows the auto-loader to require but ignore files like operation_types.js)

I've refactored all of the commands so that they no longer require instancing, and instead export the "operation" property, and the "read" and "write" methods.

This commit also includes a test I'd forgotten to add several commits back. The just just makes sure that manager fires callback(err) on a failed DB_OPEN instead of leaving the caller hanging.