Class: Bundlebun::Platform

Inherits:
Object
  • Object
show all
Defined in:
lib/bundlebun/platform.rb,
sig/bundlebun/platform.rbs

Overview

Platform contains a set of helpers to deal with platform detection. Mostly, to see if we are running on Windows.

Class Method Summary collapse

Class Method Details

.windows? ⇒ Boolean

Are we running on Windows?

Returns:

  • (Boolean)


11
12
13
14
15
16
# File 'lib/bundlebun/platform.rb', line 11

def windows?
  return @windows if defined?(@windows)

  @windows = (defined?(RbConfig) && defined?(RbConfig::CONFIG) &&
    RbConfig::CONFIG['host_os'].match?(/mswin|mingw|cygwin/)).freeze
end