Yes! It has tests! They are on runcoderun
Assuming you have the following files in public:
You can bundle these files in your app like this:
% [sudo] gem install sinatra-bundles
In your app:
Then in your view, you can use the view helpers to insert the proper script tags:
All 6 of those files will be served up in 2 files, and they'll be compressed and have headers set for caching.
The defaults are pretty good. In development/test mode:
bundle_cache_time # => 60 * 60 * 24 * 365, or 1 year compress_bundles # => false cache_bundles # => false stamp_bundles # => true
And in production mode, compression and caching are enabled
compress_bundles # => true cache_bundles # => true
To change any of these, use set/enable/disable
That's pretty much it. My blog uses this, so check out the code for it if you want a more real example. It's on github
sinatra-bundles is also on github
There are docs, and you can run rake yard to generate them, but
rdoc.info and yardoc.org don't want to place nice right now, so they
aren't actually available yet.
Coming soon though! Docs are located
The caveat? You need sinatra 0.10.1 (edge).
Fork away, report bugs, and submit patches! Go on now my pretties!