Padrino::Sprockets provides integration with the Padrino web framework.
Install from RubyGems:
$ gem install padrino-sprockets
Or include it in your project's
Gemfile with Bundler:
gem 'padrino-sprockets', :require => "padrino/sprockets"
Place your assets under these paths:
Register sprockets in your application:
class Redstore < Padrino::Application register Padrino::Sprockets sprockets # :url => 'assets', :root => app.root end
Now when requesting a path like
/assets/application.js it will look for a source file in one of these locations :
In your Gemfile:
# enable js minification gem 'uglifier' # enable css compression gem 'yui-compressor'
In your app:
class Redstore < Padrino::Application register Padrino::Sprockets sprockets :minify => (Padrino.env == :production) end
For more documentation about sprockets, have a look at the Sprockets gem.
:root => 'asset root' # default is app.root :url => 'assets' # default map url, location, default is 'assets'