Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add development dependency on Guard

  • Loading branch information...
commit 5969672750ee20abbbd19ef3ad5c751df4bf543e 1 parent 8025b70
@njonsson authored
Showing with 22 additions and 0 deletions.
  1. +5 −0 Gemfile
  2. +17 −0 Guardfile
View
5 Gemfile
@@ -12,6 +12,11 @@ group :debug do
gem 'ruby-debug19', :platforms => :mri_19
end
+group :development do
+ gem 'guard-rspec'
+ gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
+end
+
group :doc do
gem 'yard', :platforms => [:ruby, :mswin, :mingw]
gem 'rdiscount', :platforms => [:ruby, :mswin, :mingw]
View
17 Guardfile
@@ -0,0 +1,17 @@
+guard 'rspec', :cli => '--color', :version => 2 do
+ # Run the corresponding spec (or all specs) when code changes.
+ watch( %r{^lib/(.+)\.rb$} ) do |match|
+ corresponding_spec = "spec/#{match[1]}_spec.rb"
+ if File.file?( File.expand_path( "../#{corresponding_spec}", __FILE__ ))
+ corresponding_spec
+ else
+ 'spec'
+ end
+ end
+
+ # Run a spec when it changes.
+ watch %r{^spec/.+_spec\.rb$}
+
+ # Run all specs when the bundle changes.
+ watch( 'Gemfile.lock' ) { 'spec' }
+end
Please sign in to comment.
Something went wrong with that request. Please try again.