From 447dc60ededf4f330463e3e61f9a9a53a3efbb2a Mon Sep 17 00:00:00 2001 From: Dmytrii Nagirniak Date: Tue, 11 Oct 2011 10:06:36 +1100 Subject: [PATCH] do clean the assets --- lib/guard/rails-assets/rails_runner.rb | 8 ++++++++ lib/guard/version.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/guard/rails-assets/rails_runner.rb b/lib/guard/rails-assets/rails_runner.rb index 1311252..235682e 100644 --- a/lib/guard/rails-assets/rails_runner.rb +++ b/lib/guard/rails-assets/rails_runner.rb @@ -36,6 +36,13 @@ module Guard @@rails_booted = true end + def clean + Rake::Task["tmp:cache:clear"].execute + # copy from the "assets:clean" Rake task + config = ::Rails.application.config + public_asset_path = File.join(Rails.public_path, config.assets.prefix) + rm_rf public_asset_path, :secure => true + end def precompile config = Rails.application.config @@ -73,6 +80,7 @@ module Guard self.class.boot_rails return false unless @@rails_booted begin + clean precompile true rescue => e diff --git a/lib/guard/version.rb b/lib/guard/version.rb index 1a40650..3c14905 100644 --- a/lib/guard/version.rb +++ b/lib/guard/version.rb @@ -1,5 +1,5 @@ module Guard module RailsAssetsVersion - VERSION = "0.1.0" + VERSION = "0.1.1" end end