initial commit
This commit is contained in:
commit
3f7d19cba2
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
*.gem
|
||||||
|
.bundle
|
||||||
|
Gemfile.lock
|
||||||
|
pkg/*
|
4
Gemfile
Normal file
4
Gemfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
source "http://rubygems.org"
|
||||||
|
|
||||||
|
# Specify your gem's dependencies in guard-rspec-hydra.gemspec
|
||||||
|
gemspec
|
22
guard-rspec-hydra.gemspec
Normal file
22
guard-rspec-hydra.gemspec
Normal 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
0
lib/guard-rspec-hydra.rb
Normal file
36
lib/guard/rspec-hydra.rb
Normal file
36
lib/guard/rspec-hydra.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user