Created
January 7, 2013 15:09
-
-
Save zhangsen/4475660 to your computer and use it in GitHub Desktop.
Revisions
-
zhangsen created this gist
Jan 7, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ # # Rails template: rspec, guard, spork, libnotify, capybara # $ rails -T -m <path-to-me> gem_group :development, :test do gem 'rspec-rails' gem 'guard-rspec' gem 'guard-spork' gem 'spork' end gem_group :test do gem 'capybara', '1.1.2' gem 'rb-inotify' gem 'libnotify' end run 'bundle install' # rspec generate 'rspec:install' # spork run 'spork rspec --bootstrap' def indent(s) (s.split("\n").map { |ln| ln.length > 0 ? " " + ln : ln} ).join("\n") end # spork - spec/spec_helper.rb File.open('spec/spec_helper.rb') do |f| t = f.read.match(/(#\sThis file is copied to.*)/m)[1] gsub_file 'spec/spec_helper.rb', /Spork.prefork do.*/m, <<-EOF Spork.prefork do #{indent(t)} end Spork.each_run do load "\#{::Rails.root}/config/routes.rb" end EOF end # guard run 'guard init spork' run 'guard init rspec' # guard: libnotify settings inject_into_file 'Guardfile', "notification :libnotify, :transient => true\n\n", :before => /^guard 'spork'.*/ # guard: --drb gsub_file 'Guardfile', "guard 'rspec', do", "guard 'rspec', :cli => '--drb' do"