181: def start
182: if options[:debug]
183: $DEBUG = true
184: require 'pp'
185: p options[:server]
186: pp wrapped_app
187: pp app
188: end
189:
190: if options[:warn]
191: $-w = true
192: end
193:
194: if includes = options[:include]
195: $LOAD_PATH.unshift(*includes)
196: end
197:
198: if library = options[:require]
199: require library
200: end
201:
202: daemonize_app if options[:daemonize]
203: write_pid if options[:pid]
204:
205: trap(:INT) do
206: if server.respond_to?(:shutdown)
207: server.shutdown
208: else
209: exit
210: end
211: end
212:
213: server.run wrapped_app, options
214: end