Class: AMQP::Utilities::ServerType

### Home Classes Methods

### In Files

- lib/amqp/utilities/server_type.rb

### Parent

Object

### Methods

- ::detect

### Class/Module Index

Quicksearch

- AMQP
- AMQP::Broker
- AMQP::ChannelClosedError
- AMQP::Consumer
- AMQP::Error
- AMQP::Header
- AMQP::IncompatibleOptionsError
- AMQP::Integration
- AMQP::Integration::Rails
- AMQP::PossibleAuthenticationFailureError
- AMQP::Session
- AMQP::TCPConnectionFailed
- AMQP::Utilities
- AMQP::Utilities::EventLoopHelper
- AMQP::Utilities::ServerType

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.