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
|
#!/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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user