blob: 78e968fe493084ec94cd0d25a2c73156f1fee261 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# frozen_string_literal: true
require "rbconfig"
module Gem
##
# An Array of Regexps that match windows Ruby platforms.
WIN_PATTERNS = [
/bccwin/i,
/cygwin/i,
/djgpp/i,
/mingw/i,
/mswin/i,
/wince/i,
].freeze
@@win_platform = nil
##
# Is this a windows platform?
def self.win_platform?
if @@win_platform.nil?
ruby_platform = RbConfig::CONFIG["host_os"]
@@win_platform = !WIN_PATTERNS.find {|r| ruby_platform =~ r }.nil?
end
@@win_platform
end
end
|