make it nicer to work with and run
This commit is contained in:
parent
5d51d38977
commit
bf1e114719
|
@ -1,11 +1,9 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'rubygems'
|
||||
require 'bundler'
|
||||
if !ENV['BUNDLE_GEMFILE'] && File.file?('Gemfile')
|
||||
require 'rubygems'
|
||||
require 'bundler/setup'
|
||||
|
||||
begin
|
||||
Bundler.setup(:default)
|
||||
rescue Bundler::GemfileNotFound
|
||||
$: << File.expand_path('../../lib', __FILE__)
|
||||
end
|
||||
|
||||
|
|
|
@ -41,7 +41,10 @@ module Attentive
|
|||
Pygments.highlight("attentive")
|
||||
|
||||
Rack::Handler.default.run(Attentive::Server, :Port => options[:port]) do |server|
|
||||
trap(:INT) { server.shutdown }
|
||||
trap(:INT) do
|
||||
server.shutdown if server.respond_to?(:server)
|
||||
server.stop if server.respond_to?(:stop)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue