Let you configure a Guard that will run compass whenever a stylesheet is updated.
$ (sudo) gem install compass
$ compass -f blueprint my_compass_project
$ cd my_compass_project
$ bundle init
Then, edit the Gemfile for it to looks like:
source "http://rubygems.org"
gem 'guard-compass'
You can now download missing gems and initialize the guard
$ bundle install
$ guard init
$ guard init compass
$ guard
Your scss(or sass) stylesheets are now guarded.
The default configuration generated by ‘guard init compass’ looks like this
guard 'compass' do
You can override Compass options from the Guard declaration. You want to use
that if Guard cannot locate your compass configuration file. In this case use:
- :project_path: path to the compass project directory (from guard working directory)
- :configuration_file: path to your compass configuration file (from guard working directory)
By default, the project path is equal to the guard working directory(the folder from where you start Guard).
Compass will look into some default location for the config file from there.
The configuration_file is computed by compass. You don’t need to define watchers like
in other Guard plug-in because they are generated from the Compass configuration files, cool!
For the complete list of options, please refer to the Compass documentation.
- Implements notifications
- Create a watch rule based on the compass config file
- Detect rails install and generate watcher accordingly