Skip to content

Commit

Permalink
Fixup macOS detection (#3238)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Sep 29, 2023
1 parent 252890c commit 02a7d01
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions lib/puma/detect.rb
Expand Up @@ -12,15 +12,14 @@ module Puma

IS_JRUBY = Object.const_defined? :JRUBY_VERSION

IS_OSX = RUBY_PLATFORM.include? 'darwin'
IS_OSX = RUBY_DESCRIPTION.include? 'darwin'

IS_WINDOWS = !!(RUBY_PLATFORM =~ /mswin|ming|cygwin/) ||
IS_JRUBY && RUBY_DESCRIPTION.include?('mswin')
IS_WINDOWS = RUBY_DESCRIPTION.match?(/mswin|ming|cygwin/)

IS_LINUX = !(IS_OSX || IS_WINDOWS)

# @version 5.2.0
IS_MRI = (RUBY_ENGINE == 'ruby' || RUBY_ENGINE.nil?)
IS_MRI = RUBY_ENGINE == 'ruby'

def self.jruby?
IS_JRUBY
Expand Down
1 change: 0 additions & 1 deletion test/helpers/integration.rb
Expand Up @@ -9,7 +9,6 @@
# have their own files, use those instead
class TestIntegration < Minitest::Test
include TmpPath
DARWIN = RUBY_PLATFORM.include? 'darwin'
HOST = "127.0.0.1"
TOKEN = "xxyyzz"
RESP_READ_LEN = 65_536
Expand Down
5 changes: 4 additions & 1 deletion test/helpers/tmp_path.rb
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module TmpPath
def clean_tmp_paths
while path = tmp_paths.pop
Expand All @@ -14,7 +16,8 @@ def clean_tmp_paths
#
PUMA_TMPDIR =
begin
if RUBY_PLATFORM.include? 'darwin'
if RUBY_DESCRIPTION.include? 'darwin'
# adds subdirectory 'tmp' in repository folder
dir_temp = File.absolute_path("#{__dir__}/../../tmp")
Dir.mkdir dir_temp unless Dir.exist? dir_temp
'./tmp'
Expand Down

0 comments on commit 02a7d01

Please sign in to comment.