module Puma

encoding: utf-8

This file can be loaded independently of puma.rb, so it cannot have any code that assumes puma.rb is loaded.

This module is used as an 'include' file in code at bottom of file

Constants

HAS_FORK

@version 5.2.1

HAS_NATIVE_IO_WAIT
HAS_SSL

at present, MiniSSL::Engine is only defined in extension code (puma_http11), not in minissl.rb

HAS_UNIX_SOCKET
HTTP_STATUS_CODES

Every standard HTTP code mapped to the appropriate message. Generated with: curl -s www.iana.org/assignments/http-status-codes/http-status-codes-1.csv | \

ruby -ne 'm = /^(\d{3}),(?!Unassigned|\(Unused\))([^,]+)/.match($_) and \
          puts "#{m[1]} => \x27#{m[2].strip}\x27,"'
IS_JRUBY
IS_LINUX
IS_MRI

@version 5.2.0

IS_OSX
IS_WINDOWS
Plugins
STATUS_WITH_NO_ENTITY_BODY

For some HTTP status codes the client only expects headers.

Attributes

cli_config[RW]

The CLI exports a Puma::Configuration instance here to allow apps to pick it up. An app must load this object conditionally because it is not set if the app is launched via any mechanism other than the CLI class.

Public Class Methods

abstract_unix_socket?() click to toggle source
# File lib/puma.rb, line 45
def self.abstract_unix_socket?
  @abstract_unix ||=
    if HAS_UNIX_SOCKET
      begin
        ::UNIXServer.new("\0puma.temp.unix").close
        true
      rescue ArgumentError  # darwin
        false
      end
    else
      false
    end
end
forkable?() click to toggle source

@version 5.0.0

# File lib/puma/detect.rb, line 42
def self.forkable?
  HAS_FORK
end
jruby?() click to toggle source
# File lib/puma/detect.rb, line 24
def self.jruby?
  IS_JRUBY
end
mri?() click to toggle source

@version 5.0.0

# File lib/puma/detect.rb, line 37
def self.mri?
  IS_MRI
end
osx?() click to toggle source
# File lib/puma/detect.rb, line 28
def self.osx?
  IS_OSX
end
set_thread_name(name) click to toggle source
# File lib/puma.rb, line 75
def self.set_thread_name(name)
  Thread.current.name = "puma #{name}"
end
ssl?() click to toggle source
# File lib/puma.rb, line 41
def self.ssl?
  HAS_SSL
end
stats() click to toggle source

@!attribute [rw] stats_object

# File lib/puma.rb, line 65
def self.stats
  Puma::JSONSerialization.generate @get_stats.stats
end
stats_hash() click to toggle source

@!attribute [r] stats_hash @version 5.0.0

# File lib/puma.rb, line 71
def self.stats_hash
  @get_stats.stats
end
stats_object=(val) click to toggle source

@!attribute [rw] stats_object=

# File lib/puma.rb, line 60
def self.stats_object=(val)
  @get_stats = val
end
windows?() click to toggle source
# File lib/puma/detect.rb, line 32
def self.windows?
  IS_WINDOWS
end