From ec965900626dce17c25599392eb96f02b4d4d2a4 Mon Sep 17 00:00:00 2001 From: Brendan Weibrecht Date: Tue, 23 Feb 2016 01:06:01 +1100 Subject: [PATCH] Add Rakefile reload instructions to readme --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index f834d67..86f0336 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,19 @@ task :doit, [:first, :second, :paths] do |t, args| end ``` +## Rakefile reload + +The Rakefile is only loaded when Guard is starting up or reloading. If you require the Rakefile to be reloaded (e.g. you are developing a Rake task and you want to continuously test its invocation), you're probably after something like this: + +```ruby +guard 'rake', :task => 'doit', :run_on_start => false do + watch('Rakefile') { + ::Rake::Task.clear + ::Rake.application.load_rakefile + 'Rakefile' + } +end +``` ## Development