README.md in guard-rails-assets-0.0.6 vs README.md in guard-rails-assets-0.0.7
- old
+ new
@@ -1,68 +1,52 @@
# Guard::RailsAssets
-Guard::RailsAssets compiles the assets in Rails 3.1 application automatically when files are modified.
+Guard::RailsAssets compiles the assets within Rails 3.1 application whenever those change.
-Tested on MRI Ruby 1.9.2 (please report if it works on your platform).
+Tested on MRI 1.9.2 (please report if it works on your platform).
If you have any questions please contact me [@dnagir](http://www.ApproachE.com).
## Install
Please be sure to have [Guard](https://github.com/guard/guard) installed.
-Install the gem:
-
Add it to your `Gemfile`, preferably inside the test and development group:
```ruby
gem 'guard-rails-assets'
```
Add guard definition to your `Guardfile` by running:
```bash
-$ guard init rails-assets
+$ bundle exec guard init rails-assets
```
-## Rails 3.1
+## Options
-The Rails 3.1 is a mandatory requirement, but is not enforeced via dependencies for now.
-The reason is that the assets can currently be compiled using following "runners":
+In addition to the guard configuration, `guard-rails-assets` has options to specify when exacly to precompile assets.
-1. rake command (CLI);
-2. loading the actual Rails environment.
-
-In the 1st case - this Guard is not actually using Rails directly while in the 2nd - it loads it explicitly.
-
-Good thing about the 1st approach is that assets will always be same as produced by Rails.
-Bad thing is that it is pretty slow (~10 seconds) because it starts Rails from ground zero.
-
-The 2nd approach is good because it is much faster, but does not reload Rails environment (so you have to restart guard).
-
-## Guardfile and Options
-
-In addition to the standard configuration, this Guard has options to specify when exacly to precompile assets.
-
- `:start` - compile assets when the guard starts (enabled by default)
- `:change` - compile assets when watched files change (enabled by default)
- `:reload` - compile assets when the guard quites (Ctrl-C) (not enabled by default)
- `:all` - compile assets when running all the guards (Ctrl-/) (not enabled by default)
Also you can set the `:runner` option:
- `:cli` - compile assets using the rake task - the most correct method, but slow.
-- `:rails` - compile assets by loading rails environment (default) - fast, but does not pick up changes.
+- `:rails` - compile assets by loading rails environment (default) - fast, but does not pick up changes. Additionally it relies on a single instance of your app to be loaded, so you can't have multiple guards with different rails configurations.
+`:rails_env` option is available that allows you to specify the Rails environment to use (defaults to 'test').
For example:
```ruby
# This is the default behaviour
-guard 'rails-assets', :run_on => [:start, :change], :runner => :rails do
+guard 'rails-assets', :run_on => [:start, :change], :runner => :rails, :rails_env => 'test' do
watch(%r{^app/assets/.+$})
end
# compile ONLY when something changes
guard 'rails-assets', :run_on => :change do