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

33 lines
592 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2012-08-10 22:35:47 -04:00
module Puma
# 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)
def self.jruby?
IS_JRUBY
end
IS_WINDOWS = RUBY_PLATFORM =~ /mswin|ming|cygwin/
def self.windows?
IS_WINDOWS
end
# @version 5.0.0
def self.mri?
2020-03-09 04:48:10 -04:00
RUBY_ENGINE == 'ruby' || RUBY_ENGINE.nil?
end
2020-04-21 19:33:13 -04:00
# @version 5.0.0
2020-04-21 19:33:13 -04:00
def self.forkable?
::Process.respond_to?(:fork)
end
end