From 2226a3025e7e64400846321a025d41f6696904e4 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sat, 18 Jun 2011 18:20:49 -0400 Subject: [PATCH] update the template so the right files get watched --- .travis.yml | 5 +++++ Gemfile | 1 + README.md | 4 ++-- Rakefile | 29 +++++++++++++++++++++++++++++ lib/guard/rocco.rb | 1 + lib/guard/rocco/templates/Guardfile | 4 ++-- 6 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..59fa011 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +rvm: + - 1.8.7 + - 1.9.2 + - ree +script: "bundle exec rake spec" diff --git a/Gemfile b/Gemfile index d4efc86..2b9f2a4 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ gemspec require 'rbconfig' gem 'guard' gem 'guard-rspec' +gem 'rake' if RbConfig::CONFIG['host_os'] =~ /darwin/ gem 'growl' diff --git a/README.md b/README.md index f3ee96e..60feaff 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ It's a [Guard](http://github.com/guard/guard) for the [Rocco](http://github.com/rtomayko/rocco) documentation system! guard 'rocco' do - watch(%r{app/.*\.(rb|coffee)}) - watch(%r{lib/.*\.rb}) + watch(%r{^app/.*\.(rb|coffee)$}) + watch(%r{^lib/.*\.rb$}) end Only one option for now: diff --git a/Rakefile b/Rakefile index 1805681..941b516 100644 --- a/Rakefile +++ b/Rakefile @@ -2,3 +2,32 @@ include Rake::DSL if defined?(Rake::DSL) require 'bundler' Bundler::GemHelper.install_tasks +require 'rspec/core/rake_task' + +RSpec::Core::RakeTask.new(:spec) + +namespace :spec do + desc "Run on three Rubies" + task :platforms do + current = %x{rvm-prompt v} + + fail = false + %w{1.8.7 1.9.2 ree}.each do |version| + puts "Switching to #{version}" + Bundler.with_clean_env do + system %{bash -c 'source ~/.rvm/scripts/rvm && rvm #{version} && bundle exec rake spec'} + end + if $?.exitstatus != 0 + fail = true + break + end + end + + system %{rvm #{current}} + + exit (fail ? 1 : 0) + end +end + +task :default => 'spec:platforms' + diff --git a/lib/guard/rocco.rb b/lib/guard/rocco.rb index 35e8181..4b6cbc1 100644 --- a/lib/guard/rocco.rb +++ b/lib/guard/rocco.rb @@ -1,5 +1,6 @@ require 'rocco' require 'guard/guard' +require 'guard/watcher' require 'fileutils' module Guard diff --git a/lib/guard/rocco/templates/Guardfile b/lib/guard/rocco/templates/Guardfile index ac0a2a4..36cc21a 100644 --- a/lib/guard/rocco/templates/Guardfile +++ b/lib/guard/rocco/templates/Guardfile @@ -1,6 +1,6 @@ guard 'rocco' do # For Rails 3.0.x and 3.1 - watch(%r{app/.*\.(rb|coffee)}) - watch(%r{lib/.*\.rb}) + watch(%r{^app/.*\.(rb|coffee)$}) + watch(%r{^lib/.*\.rb$}) end