Permalink
Browse files

Use guard to auto compile the extension on changes

  • Loading branch information...
1 parent 8b3e58c commit f0ca23cdb3ee228bc05d83e9c5db3ac70017655e @Maher4Ever committed Jul 11, 2012
Showing with 18 additions and 4 deletions.
  1. +12 −4 Guardfile
  2. +5 −0 spec/wdm_spec.rb
  3. +1 −0 wdm.gemspec
View
@@ -1,8 +1,16 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
-guard 'rspec', :all_on_start => false, :all_after_pass => false, :cli => '--fail-fast --format doc' do
- watch(%r{^spec/.+_spec\.rb$})
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
- watch('spec/spec_helper.rb') { "spec" }
+group :compile do
+ guard :shell do
+ watch(%r{ext/.+\.(?:h|c)}) { `rake compile` }
+ end
+end
+
+group :test do
+ guard :rspec, :all_on_start => false, :all_after_pass => false, :cli => '--fail-fast --format doc' do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+ end
end
View
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe WDM do
+ it { should be_a(Module) }
+end
View
@@ -18,6 +18,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency 'rake-compiler'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'guard-rspec'
+ gem.add_development_dependency 'guard-shell'
gem.add_development_dependency 'rb-readline'
gem.add_development_dependency 'rb-notifu'
end

0 comments on commit f0ca23c

Please sign in to comment.