Because Sprockets is cool, and Rails is cool, but they shouldn't get married.
gem install sinatra-sprockets
to your Gemfile
Sinatra Sprockets needs to be configured to work properly. In your server initialization, add a configuration :
The only required field is
app which is necessary to translate app configuration to Sprockets. You will also want to
append_paths as none are included by default. See Configuration for more information.
Sinatra::Sprockets::Helpers as helpers in your application :
And mount the environment :
map '/assets' do run Sinatra::Sprockets.environment end
Sprockets requires a decent amount of configuration to work properly. Most of the options listed here are taken from the Sprockets/Rails integration. You can get more detailed information in the Rails guide on asset pipelines.
digest : Boolean value. Should Sprockets use "digest" asset paths? That is, should asset paths be fingerprinted using file digests for cache busting? For more information. This is on by default, though you may want to turn it off in development.
compile: Boolean value.
There's no testing or documentation. I know. Want to help?
Questions, requests, concerns? Find me at the gorgon lab