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 #!/usr/bin/env ruby
require 'rubygems' if !ENV['BUNDLE_GEMFILE'] && File.file?('Gemfile')
require 'bundler' require 'rubygems'
require 'bundler/setup'
begin
Bundler.setup(:default)
rescue Bundler::GemfileNotFound
$: << File.expand_path('../../lib', __FILE__) $: << File.expand_path('../../lib', __FILE__)
end end

View File

@ -41,7 +41,10 @@ module Attentive
Pygments.highlight("attentive") Pygments.highlight("attentive")
Rack::Handler.default.run(Attentive::Server, :Port => options[:port]) do |server| 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
end end