1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/lib/puma/detect.rb
MSP-Greg b7748849b4
Try to fix intermittent CI issues (#2739)
* TestIntegrationSingle#test_closed_listener - fix on older OSX
* detect.rb - Add OSX / darwin detection
* TestIntegration#wait_for_server_to_boot - give OSX a delay for boot
* test/helpers/integration.rb - CI fixes
* TestIntegrationCluster#thread_run_pid - try faxt_connect (no read)

Co-authored-by: Patrik Ragnarsson <patrik@starkast.net>
2021-10-31 12:06:58 +01:00

42 lines
730 B
Ruby

# frozen_string_literal: true
# This file can be loaded independently of puma.rb, so it cannot have any code
# that assumes puma.rb is loaded.
module Puma
# @version 5.2.1
HAS_FORK = ::Process.respond_to? :fork
IS_JRUBY = Object.const_defined? :JRUBY_VERSION
IS_OSX = RUBY_PLATFORM.include? 'darwin'
IS_WINDOWS = !!(RUBY_PLATFORM =~ /mswin|ming|cygwin/) ||
IS_JRUBY && RUBY_DESCRIPTION.include?('mswin')
# @version 5.2.0
IS_MRI = (RUBY_ENGINE == 'ruby' || RUBY_ENGINE.nil?)
def self.jruby?
IS_JRUBY
end
def self.osx?
IS_OSX
end
def self.windows?
IS_WINDOWS
end
# @version 5.0.0
def self.mri?
IS_MRI
end
# @version 5.0.0
def self.forkable?
HAS_FORK
end
end