use bin/merb if it's available for appserver startup

This commit is contained in:
Corey Donohoe 2009-02-18 12:31:52 -07:00
parent 92565d3bc4
commit ec06c76b91

View File

@ -41,7 +41,11 @@ module Webrat
exec 'rackup', File.expand_path(Dir.pwd + '/config.ru'), '-p', Webrat.configuration.application_port.to_s
end
when :merb
system("merb -d -p #{Webrat.configuration.application_port} -e #{Webrat.configuration.application_environment}")
cmd = 'merb'
if File.exist?('bin/merb')
cmd = 'bin/merb'
end
system("#{cmd} -d -p #{Webrat.configuration.application_port} -e #{Webrat.configuration.application_environment}")
else # rails
system("mongrel_rails start -d --chdir='#{RAILS_ROOT}' --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &")
end