dperini/nwmatcher — pull request #49 by rvagg (2012-01-02 04:06:59+00:00)
Title: Ender integration

For your consideration.

Added an Ender bridge file which is used to link NW into Ender. It makes itself the default selector engine by attaching to `$._selector` so all `$(selector)` queries are processed by NW. I've also added in `$(els).match(selector)`, `$(els).is(selector)` (alias for `match`), `$(els).find(selector)` and `$(els).and(selector)`. Plus even though the global `NW` is hidden, you can retrieve it for advanced usage with a `require('nwmatcher')` at any time.

The test suite is basically a copy of the [Qwery](https://github.com/ded/qwery) test suite but it works against the global `ender` (`$`) object so it's sort of an integration test that tests that you can use NW just like Qwery. The only thing missing is tests for *find* and *and* but I thought I'd get this submitted rather than wait to find time to add those.

The package.json is fine as-is for NPM and once you do an `npm publish` it'll be available for Ender builds, for example: `ender build nwmatcher bonzo reqwest underscore`.

I've tested it against once of my large projects, switching our Qwery for NW, and it all works nicely.

If you're happy to merge this and publish to NPM then I'll add an entry to the [Ender Wiki](https://github.com/ender-js/Ender/wiki/Ender-package-list) and put a note in the next Ender Roundup on dailyjs.com.