From 69e883a67a71c19c0cd57806599be4e14312a56d Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 3 Aug 2011 18:53:10 -0400 Subject: [PATCH] working --- lib/guard-rspec-hydra.rb | 1 + lib/guard/rspec-hydra.rb | 46 +++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/lib/guard-rspec-hydra.rb b/lib/guard-rspec-hydra.rb index e69de29..6248e02 100644 --- a/lib/guard-rspec-hydra.rb +++ b/lib/guard-rspec-hydra.rb @@ -0,0 +1 @@ +require 'guard/rspec-hydra' diff --git a/lib/guard/rspec-hydra.rb b/lib/guard/rspec-hydra.rb index 96d2a48..b794f5b 100644 --- a/lib/guard/rspec-hydra.rb +++ b/lib/guard/rspec-hydra.rb @@ -2,35 +2,33 @@ require 'guard' require 'guard/guard' require 'guard/rspec' -module Guard - class RSpecHydra < Guard::RSpec - def initialize(watchers = [], options = {}) - super +class Guard::RSpecHydra < Guard::RSpec + def initialize(watchers = [], options = {}) + super - @options = { - :rails_env => 'test', - :rake_task => 'hydra:spec', - :runner_log => 'hydra-runner.log', - :show_runner_log => true - }.merge(@options) - end + @options = { + :rails_env => 'test', + :rake_task => 'hydra:spec', + :runner_log => 'hydra-runner.log', + :show_runner_log => true + }.merge(@options) + end - def start - UI.info "Guard::Hydra is giving Guard::RSpec super run_all powers. Whoa!" - super - end + def start + Guard::UI.info "Guard::Hydra is giving Guard::RSpec super run_all powers. Whoa!" + super + end - def run_all - File.unlink(@options[:runner_log]) if runner_log? + def run_all + File.unlink(@options[:runner_log]) if runner_log? - system %{rake RAILS_ENV=#{@options[:rails_env]} #{@options[:rake_task]}} + system %{rake RAILS_ENV=#{@options[:rails_env]} #{@options[:rake_task]}} - puts File.read(@options[:runner_log]) if runner_log? && @options[:show_runner_log] - end + puts File.read(@options[:runner_log]) if runner_log? && @options[:show_runner_log] + end - private - def runner_log? - File.exist?(@options[:runner_log]) - end + private + def runner_log? + File.exist?(@options[:runner_log]) end end