initial commit

This commit is contained in:
John Bintz 2011-08-03 18:49:53 -04:00
commit 3f7d19cba2
6 changed files with 67 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.gem
.bundle
Gemfile.lock
pkg/*

4
Gemfile Normal file
View File

@ -0,0 +1,4 @@
source "http://rubygems.org"
# Specify your gem's dependencies in guard-rspec-hydra.gemspec
gemspec

1
Rakefile Normal file
View File

@ -0,0 +1 @@
require 'bundler/gem_tasks'

22
guard-rspec-hydra.gemspec Normal file
View File

@ -0,0 +1,22 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = "guard-rspec-hydra"
s.version = '0.0.1'
s.authors = ["John Bintz"]
s.email = ["john@coswellproductions.com"]
s.homepage = ""
s.summary = %q{Extend Guard::RSpec to use Hydra to run all specs. Super-fast!}
s.description = %q{Extend Guard::RSpec to use Hydra to run all specs. Super-fast!}
s.rubyforge_project = "guard-rspec-hydra"
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
s.add_dependency 'guard', '>= 0.5.0'
s.add_dependency 'guard-rspec'
end

0
lib/guard-rspec-hydra.rb Normal file
View File

36
lib/guard/rspec-hydra.rb Normal file
View File

@ -0,0 +1,36 @@
require 'guard'
require 'guard/guard'
require 'guard/rspec'
module Guard
class 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
def start
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?
system %{rake RAILS_ENV=#{@options[:rails_env]} #{@options[:rake_task]}}
puts File.read(@options[:runner_log]) if runner_log? && @options[:show_runner_log]
end
private
def runner_log?
File.exist?(@options[:runner_log])
end
end
end