Created
August 14, 2011 07:29
-
-
Save ches/1144671 to your computer and use it in GitHub Desktop.
Reusing Guard tasks via Rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# There are a couple minor quirks (see https://github.com/guard/guard/issues/118), | |
# but mostly this is delightfully straightforward: | |
require 'guard' | |
namespace :assets do | |
desc 'Generate CSS from all source LESS files' | |
task :less do | |
Guard.setup | |
Guard::Dsl.evaluate_guardfile(:guardfile => 'Guardfile', :group => ['frontend']) | |
# Would be nice if these were in a hash keyed by name: | |
less = Guard.guards.select { |g| g.is_a? Guard::Less }.first | |
less.run_all | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment