make it nicer to work with and run

This commit is contained in:
John Bintz 2012-03-23 08:47:08 -04:00
parent 5d51d38977
commit bf1e114719
2 changed files with 7 additions and 6 deletions

View File

@ -1,11 +1,9 @@
#!/usr/bin/env ruby
if !ENV['BUNDLE_GEMFILE'] && File.file?('Gemfile')
require 'rubygems'
require 'bundler'
require 'bundler/setup'
begin
Bundler.setup(:default)
rescue Bundler::GemfileNotFound
$: << File.expand_path('../../lib', __FILE__)
end

View File

@ -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