Home

Awesome

Guard Sprockets 2

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

Usage

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:

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

Sinatra

require './app'

guard 'sprockets2', :sprockets => App.sprockets do
  watch(%r{^assets/.+$})
  watch('app.rb')
end

Rails

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

require './config/environment'

guard 'sprockets2' do
  watch(%r{^app/assets/.+$})
  watch('config/application.rb')
end