Add a simple proc to detect windows locally

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
Clinton Wolfe 2021-11-13 01:43:29 -05:00
parent f32b8f7983
commit 8aad4abe0c

View file

@ -18,4 +18,9 @@ module Inspec
require "etc" unless defined?(Etc) require "etc" unless defined?(Etc)
Etc.getpwuid.dir Etc.getpwuid.dir
end end
def self.locally_windows?
require "rbconfig" unless defined?(RbConfig)
RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/
end
end end