/usr/lib/ruby/vendor_ruby/merb-core/rack/adapter/mongrel.rb is in ruby-merb-core 1.1.3+dfsg-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | begin
require 'mongrel'
rescue LoadError => e
Merb.fatal! "Mongrel is not installed, but you are trying to use it. " \
"You need to either install mongrel or a different Ruby web " \
"server, like thin."
end
require 'merb-core/rack/handler/mongrel'
module Merb
module Rack
class Mongrel < Merb::Rack::AbstractAdapter
# :api: plugin
def self.stop(status = 0)
if @server
begin
@server.stop(true)
rescue Mongrel::TimeoutError
Merb.logger.fatal! "Your process took too long to shut " \
"down, so mongrel killed it."
end
true
end
end
# :api: plugin
def self.new_server(port)
@server = ::Mongrel::HttpServer.new(@opts[:host], port)
end
# :api: plugin
def self.start_server
@server.register('/', ::Merb::Rack::Handler::Mongrel.new(@opts[:app]))
@server.run.join
end
end
end
end
|