From fb398d172ae1a2a2a8dbc95766f576ffb3355cb3 Mon Sep 17 00:00:00 2001 From: Ranmocy Date: Sat, 19 Jan 2013 23:38:58 +0800 Subject: [PATCH] support zeus to boost rails init --- README.md | 1 + lib/guard/rails/runner.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4047c1c..4720a3c 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Lots of fun options! * `:timeout` waits this number of seconds when restarting the Rails server before reporting there's a problem (default `20`). * `:server` lets you specify the webserver engine to use (try `:server => :thin`). * `:pid_file` specify your pid_file, so that maybe you can run multiple instances with same rails_env (default `tmp/pids/[RAILS_ENV].pid`) +* `:zeus` support [zeus](https://github.com/burke/zeus) to boost rails init speed. This is super-alpha, but it works for me! Only really hand-tested in Mac OS X. Feel free to fork'n'fix for other OSes, and to add some more real tests. diff --git a/lib/guard/rails/runner.rb b/lib/guard/rails/runner.rb index 649dd25..8dad1aa 100644 --- a/lib/guard/rails/runner.rb +++ b/lib/guard/rails/runner.rb @@ -42,7 +42,9 @@ module Guard rails_options << '-u' if options[:debugger] rails_options << options[:server] if options[:server] - %{sh -c 'cd #{Dir.pwd} && RAILS_ENV=#{options[:environment]} rails s #{rails_options.join(' ')} &'} + rails_command = options[:zeus] ? 'zeus' : 'rails' + + %{sh -c 'cd #{Dir.pwd} && RAILS_ENV=#{options[:environment]} #{rails_command} s #{rails_options.join(' ')} &'} end def pid_file