### Home Classes Methods

### In Files

- lib/amqp/utilities/server_type.rb

### Parent

Object

### Methods

- ::detect

### Class/Module Index

Quicksearch

- AMQP
- AMQP::BitSet
- AMQP::BlankSlate
- AMQP::Broker
- AMQP::Channel
- AMQP::ChannelClosedError
- AMQP::Client
- AMQP::Consumer
- AMQP::Error
- AMQP::Exchange
- AMQP::Header
- AMQP::IncompatibleOptionsError
- AMQP::IntAllocator
- AMQP::Integration
- AMQP::Integration::Rails
- AMQP::Logger
- AMQP::PossibleAuthenticationFailureError
- AMQP::Queue
- AMQP::RPC
- AMQP::RPC::Client
- AMQP::RPC::Server
- AMQP::Session
- AMQP::TCPConnectionFailed
- AMQP::Utilities
- AMQP::Utilities::EventLoopHelper
- AMQP::Utilities::ServerType
- MQ
- MQ::Exchange
- MQ::Logger
- MQ::Queue
- EM
- Object

No matching classes.

# AMQP::Utilities::ServerType

A helper that detects Web server that may be running (if any). Partially derived from Qusion project by Daniel DeLeo.

### Public Class Methods

detect() click to toggle source

Return a symbol representing Web server that is running (if any).

Possible values are:

    * :thin for Thin
    * :unicorn for Unicorn
    * :passenger for Passenger (Apache mod_rack)
    * :goliath for PostRank's Goliath
    * :evented_mongrel for Swiftiply's Evented Mongrel
    * :mongrel for Mongrel
    * :scgi for SCGI
    * :webrick for WEBrick
    * nil: none of the above (the case for non-Web application, for example)

@return [Symbol]

    # File lib/amqp/utilities/server_type.rb, line 46
    def self.detect
      if defined?(::PhusionPassenger)
        :passenger
      elsif defined?(::Unicorn)
        :unicorn
      elsif defined?(::Thin)
        :thin
      elsif defined?(::Goliath)
        :goliath
      elsif defined?(::Mongrel) && defined?(::Mongrel::MongrelProtocol)
        :evented_mongrel
      elsif defined?(::Mongrel)
        :mongrel
      elsif defined?(::SCGI)
        :scgi
      elsif defined?(::WEBrick)
        :webrick
      else
        nil
      end # if
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.