lib/guard/rake.rb in guard-rake-0.0.4 vs lib/guard/rake.rb in guard-rake-0.0.5

- old
+ new

@@ -2,22 +2,23 @@ require 'guard/guard' require 'rake' module Guard class Rake < Guard - include ::Rake::DSL - def initialize(watchers=[], options={}) super @options = { - run_on_all: true + :run_on_start => true, + :run_on_all => true }.update(options) @task = @options[:task] end def start UI.info "Starting guard-rake #{@task}" - load 'Rakefile' + ::Rake.application.init + ::Rake.application.load_rakefile + run_all if @options[:run_on_start] true end def stop UI.info "Stopping guard-rake #{@task}"