lib/sniff/rake_tasks.rb in sniff-0.8.4 vs lib/sniff/rake_tasks.rb in sniff-0.8.5

- old
+ new

@@ -9,19 +9,20 @@ def self.define_tasks(&blk) new(&blk).define_tasks end - attr_accessor :earth_domains, :cucumber, :rspec, :coverage, :rocco, :bueller + attr_accessor :earth_domains, :cucumber, :rspec, :coverage, :rocco, :bueller, :watchr def initialize self.earth_domains = :all self.cucumber = true self.rspec = false self.coverage = true self.rocco = true self.bueller = true + self.watchr = true yield self if block_given? end def ruby18? RUBY_VERSION =~ /^1\.8/ ? true : false @@ -208,9 +209,20 @@ end if bueller require 'bueller' Bueller::Tasks.new + end + + if watchr + namespace :watch do + task :tests do + require 'watchr' + path = File.expand_path(Sniff.path(%w{lib sniff watcher.rb})) + script = Watchr::Script.new Pathname(path) + Watchr::Controller.new(script, Watchr.handler.new).run + end + end end end end end