Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Guard for compiling sprockets assets
Ruby Other
branch: master

Merge pull request #3 from cloudify/master

Added support for manifest.yml
latest commit 7e5d20d228
@stevehodgkiss authored
Failed to load latest commit information.
features Initial commit
lib/guard added support for generation of manifest.yml
spec added support for generation of manifest.yml
.gitignore Add .sass-cache to gitignore
.rspec Initial commit
Gemfile Initial commit
LICENSE Initial commit added support for generation of manifest.yml
Rakefile Initial commit
guard-sprockets2.gemspec Update gem spec

Guard Sprockets 2

A Guard for Sprockets 2 that works with Rails, Sinatra or any other Rack app.


Add it to your Gemfile:

gem 'guard-sprockets2'

Add the guard definition to your Guardfile:

bundle exec guard init sprockets2

Configure guard for your environment. The following options are available:

  • sprockets - Required. Set it to an instance of Sprockets::Environment
  • assets_path - Optional. The compiled assets path. Defaults to public/assets
  • precompile - Optional. An array of regex's or strings which match files that need compiling. Defaults to [ /\w+\.(?!js|css).+/, /application.(css|js)$/ ]
  • digest - Optional. Whether to include the digest in the filename. Defaults to true.
  • gz - Optional. Whether to compile a gzipped version of each file. Defaults to true.
  • clean - Optional. Whether to remove all files in the asset path. Defaults to true.
  • manifest - Optional. Whether to generate a manifest.yml file. Defaults to false.
  • manifest_path - Optional. Where to generate the manifest file. Defaults same as assets_path.

Example Rails and Sinatra apps can be found in the examples directory.


require './app'

guard 'sprockets2', :sprockets => App.sprockets do


When Rails is loaded the defaults come from Rails' configuration.

require './config/environment'

guard 'sprockets2' do
Something went wrong with that request. Please try again.