diff --git a/lib/guard/rails.rb b/lib/guard/rails.rb index 11758bc..a29636e 100644 --- a/lib/guard/rails.rb +++ b/lib/guard/rails.rb @@ -13,7 +13,8 @@ module Guard :start_on_start => true, :force_run => false, :timeout => 20, - :server => nil + :server => nil, + :debugger => nil } def initialize(watchers = [], options = {}) diff --git a/lib/guard/rails/runner.rb b/lib/guard/rails/runner.rb index 322005c..67c49ce 100644 --- a/lib/guard/rails/runner.rb +++ b/lib/guard/rails/runner.rb @@ -33,6 +33,7 @@ module Guard rails_options = [ '-e', options[:environment], '-p', options[:port], + '-u', options[:debugger], '--pid', pid_file ] diff --git a/spec/lib/guard/rails/runner_spec.rb b/spec/lib/guard/rails/runner_spec.rb index 73f6b76..122482b 100644 --- a/spec/lib/guard/rails/runner_spec.rb +++ b/spec/lib/guard/rails/runner_spec.rb @@ -46,6 +46,14 @@ describe Guard::RailsRunner do runner.build_rails_command.should match(%r{ -d}) end end + + context 'debugger' do + let(:options) { default_options.merge(:debugger => true) } + + it "should have a debugger switch" do + runner.build_rails_command.should match(%r{ -u}) + end + end context 'custom server' do let(:options) { default_options.merge(:server => 'thin') }