Add custom server to options (:server => 'thin').
This commit is contained in:
parent
7429b1fbf5
commit
372e2cd24a
|
@ -12,7 +12,8 @@ module Guard
|
|||
:environment => 'development',
|
||||
:start_on_start => true,
|
||||
:force_run => false,
|
||||
:timeout => 20
|
||||
:timeout => 20,
|
||||
:server => nil
|
||||
}
|
||||
|
||||
def initialize(watchers = [], options = {})
|
||||
|
@ -23,7 +24,8 @@ module Guard
|
|||
end
|
||||
|
||||
def start
|
||||
UI.info "Guard::Rails will now restart your app on port #{options[:port]} using #{options[:environment]} environment."
|
||||
server = options[:server] ? "#{options[:server]} and " : ""
|
||||
UI.info "Guard::Rails will now restart your app on port #{options[:port]} using #{server}#{options[:environment]} environment."
|
||||
run_all if options[:start_on_start]
|
||||
end
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ module Guard
|
|||
]
|
||||
|
||||
rails_options << '-d' if options[:daemon]
|
||||
rails_options << options[:server] if options[:server]
|
||||
|
||||
%{sh -c 'cd #{Dir.pwd} && rails s #{rails_options.join(' ')} &'}
|
||||
end
|
||||
|
|
|
@ -46,6 +46,14 @@ describe Guard::RailsRunner do
|
|||
runner.build_rails_command.should match(%r{ -d})
|
||||
end
|
||||
end
|
||||
|
||||
context 'custom server' do
|
||||
let(:options) { default_options.merge(:server => 'thin') }
|
||||
|
||||
it "should have the server name" do
|
||||
runner.build_rails_command.should match(%r{thin})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#start' do
|
||||
|
|
Loading…
Reference in New Issue