2018-09-17 12:41:14 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2012-08-10 22:35:47 -04:00
|
|
|
module Puma
|
2020-07-03 16:40:13 -04:00
|
|
|
# at present, MiniSSL::Engine is only defined in extension code, not in minissl.rb
|
|
|
|
HAS_SSL = const_defined?(:MiniSSL, false) && MiniSSL.const_defined?(:Engine, false)
|
|
|
|
|
|
|
|
def self.ssl?
|
|
|
|
HAS_SSL
|
|
|
|
end
|
|
|
|
|
2012-08-10 22:35:47 -04:00
|
|
|
IS_JRUBY = defined?(JRUBY_VERSION)
|
|
|
|
|
2016-02-03 15:06:00 -05:00
|
|
|
def self.jruby?
|
|
|
|
IS_JRUBY
|
|
|
|
end
|
|
|
|
|
2016-11-22 19:27:30 -05:00
|
|
|
IS_WINDOWS = RUBY_PLATFORM =~ /mswin|ming|cygwin/
|
|
|
|
|
2016-02-03 15:06:00 -05:00
|
|
|
def self.windows?
|
2016-11-22 19:27:30 -05:00
|
|
|
IS_WINDOWS
|
2016-02-03 15:06:00 -05:00
|
|
|
end
|
2020-03-01 20:12:36 -05:00
|
|
|
|
2020-09-17 11:15:19 -04:00
|
|
|
# @version 5.0.0
|
2020-03-01 20:12:36 -05:00
|
|
|
def self.mri?
|
2020-03-09 04:48:10 -04:00
|
|
|
RUBY_ENGINE == 'ruby' || RUBY_ENGINE.nil?
|
2020-03-01 20:12:36 -05:00
|
|
|
end
|
2020-04-21 19:33:13 -04:00
|
|
|
|
2020-09-17 11:15:19 -04:00
|
|
|
# @version 5.0.0
|
2020-04-21 19:33:13 -04:00
|
|
|
def self.forkable?
|
|
|
|
::Process.respond_to?(:fork)
|
|
|
|
end
|
2016-02-03 15:06:00 -05:00
|
|
|
end
|