Sneaker is object-oriented, highly testable jQuery.
- Extends jQuery. jQuery shouldn't be synonymous with spaghetti; Sneaker lends simple structure to the best of jQuery.
- Written for CoffeeScript. Sneaker provides an object definition pattern geared towards legibility and self-documentation.
- Jasmine-friendly, with mocks. Sneaker's
APIobject has the notion of mocking responses built-in, to aid in both development and testing; and the library comes with a bundle of handy Jasmine matchers.
- Architecture-neutral. Your job shouldn't be reduced to manipulating the magic inside a black-box application object, reaching towards a rough approximation of your intended experience. Write exactly what you intend to have happen.
- Don't call it a framework. Sneaker has no interest in reinventing, reimplementing, or revolutionizing. Sneaker doesn't try to save developers from themselves. The intention with Sneaker is to bring greater clarity to your current approach through a small set of independently useful bits; nudging you towards legible, testable code that those who inherit your project will thank you for, instead of burning effigies in your likeness.
Ready to get moving?
jQuery 1.8or later is required.
- This ES5 shim is recommended if you need to support browsers that aren't fully down with ES5 stuff (*cough* IE).
sneaker.coffeeas you would any other vendored script.
- For testing with Jasmine, include
sneaker-matchers.coffeeinto your spec manifest.
Lo-Dash >= 1.0.1is used by some of the matchers.
###Read up Lots of useful words have been crammed in the Wiki.
- Firefox >= 4.0.1
- Internet Explorer >= 6.0
- Current versions of Opera, Safari, and Chrome
###Credits Sneaker was extracted from work done on the LivingSocial Merchant Center by Chris Schetter.
Sneaker surely wouldn't be a thing without the consideration and input of Kevin McConnell, Sara Flemming, Eric Brody, Rodrigo Franco, Michael Buffington, Jon Dodson, Tim Linquist, Mark Tabler, Elise Worthy, Jess Eldredge, Michael Zinn, Rein Heinrichs, Doug March, and Jonathan Phillips; and support from Maria Gutierrez, Ryan Owens, and Bruce Williams.
Source code is found under
/source. Tests are found under
$ bundle $ bundle exec guard
jasminerice employed to run tests.
While guard is running, the coffeescript will be compiled to the same file name under
/compiled, if you'd like to look it over.
$ bundle exec rake build