Guard::Preserves

This gem allows you to make changes to files in the preserves repository and have those changes automatically compiled if in a coffeescript file. The resulting files will then be copied to a directory with the same name as the modified package located in the directory specified by the destination option.

Installation

Add this line to your application's Gemfile:

gem 'guard-preserves'

And then execute:

$ bundle

Usage

The destination must be provided. An optional app_root can be set, but defaults to the location of the Guardfile. If no watch is provided, all .js and .coffee files in the directory will be watched.

guard 'preserves', destination: 'public/foo/lib' do
  #optional watch('foo/src/foo.coffee')
end

To start the guard run:

bundle exec guard --watchdir [absolute path to directory to watch]  --guardfile [absolute path to directory with guardfile]

For example, given a Rails application named 'cool-stuff' in the same parent directory as the preserves repo with the jam assets stored in app/assets/javascripts/lib with a Guardfile named Preserves-Guardfile that looks like

guard 'preserves', destination: 'app/assets/javascripts/lib'

run bundle exec guard --watchdir ~/source/preserves --guardfile ~/source/cool-stuff/Preserves-Guardfile to start the guard.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request