Verbose Logging

software development with some really amazing hair

T + G I F R

sinatra-bundles: Easy Asset Bundling For Sinatra

· · Posted in Programming
Tagged with

sinatra-bundles is an easy way to bundle CSS and Javascript assets in your sinatra application.

Yes! It has tests! They are on runcoderun

Usage

sinatra-bundles combines Javascript and CSS into one file. Meaning, you can bundle 2 or more Javascript files into one, similar with CSS stylesheets. Any bundled files are expected to be in the public directory, under 'javascripts' and 'stylesheets'

Assuming you have the following files in public:

./stylesheets/reset.css
./stylesheets/fonts.css
./stylesheets/grid.css
./javascripts/jquery.js
./javascripts/lightbox.js
./javascripts/blog.js

You can bundle these files in your app like this:

Install:

% [sudo] gem install sinatra-bundles

In your app: