Sha256: 6b8080236b0efdc519f26fdedc14e03fbaa3ebfe4547106d79459e37dee23cf3

Contents?: true

Size: 826 Bytes

Versions: 1

Compression:

Stored size: 826 Bytes

Contents

require 'thin'
module Merb
  
  module Rack

    class Thin
      # start a Thin server on given host and port.
      
      # ==== Parameters
      # opts<Hash>:: Options for Thin (see below).
      #
      # ==== Options (opts)
      # :host<String>:: The hostname that Thin should serve.
      # :port<Fixnum>:: The port Thin should bind to.
      # :app<String>>:: The application name.
      def self.start(opts={})
        Merb.logger.warn!("Using Thin adapter")
        Merb::Dispatcher.use_mutex = false
        if opts[:host].include?('/')
          opts[:host] =  "#{opts[:host]}-#{opts[:port]}"
        end  
        server = ::Thin::Server.start(opts[:host], opts[:port].to_i, opts[:app])
        Merb::Server.change_privilege
        ::Thin::Logging.silent = true
        server.start!
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
merb-core-0.9.3 lib/merb-core/rack/adapter/thin.rb