Merge pull request #2 from joelmoss/debugger
Added support for setting the debugger (-u flag)
This commit is contained in:
commit
0a82cb086e
@ -14,6 +14,7 @@ Lots of fun options!
|
||||
* `:start_on_start` will start the server when starting Guard (default `true`)
|
||||
* `:force_run` kills any process that's holding open the listen port before attempting to (re)start Rails (default `false`).
|
||||
* `:daemon` runs the server as a daemon, without any output to the terminal that ran `guard` (default `false`).
|
||||
* `:debugger` runs the server with the debugger enabled (default `false`). Required ruby-debug gem.
|
||||
* `:timeout` waits this number of seconds when restarting the Rails server before reporting there's a problem (default `20`).
|
||||
|
||||
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
|
||||
|
@ -13,7 +13,8 @@ module Guard
|
||||
:start_on_start => true,
|
||||
:force_run => false,
|
||||
:timeout => 20,
|
||||
:server => nil
|
||||
:server => nil,
|
||||
:debugger => false
|
||||
}
|
||||
|
||||
def initialize(watchers = [], options = {})
|
||||
|
@ -23,7 +23,7 @@ module Guard
|
||||
FileUtils.rm pid_file
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def restart
|
||||
stop
|
||||
start
|
||||
@ -37,6 +37,7 @@ module Guard
|
||||
]
|
||||
|
||||
rails_options << '-d' if options[:daemon]
|
||||
rails_options << '-u' if options[:debugger]
|
||||
rails_options << options[:server] if options[:server]
|
||||
|
||||
%{sh -c 'cd #{Dir.pwd} && rails s #{rails_options.join(' ')} &'}
|
||||
|
@ -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') }
|
||||
|
Loading…
Reference in New Issue
Block a user