Module: J1::Utils::Platforms
Instance Method Summary collapse
- #bash_on_windows? ⇒ Boolean
- #linux? ⇒ Boolean
-
#vanilla_windows? ⇒ Boolean
(also: #really_windows?)
– Allows you to detect “real” Windows, or what we would consider “real” Windows.
- #windows? ⇒ Boolean
Instance Method Details
#bash_on_windows? ⇒ Boolean
36 37 38 39 |
# File 'lib/j1/utils/platforms.rb', line 36 def bash_on_windows? RbConfig::CONFIG["host_os"] =~ %r!linux! && \ proc_version =~ %r!microsoft!i end |
#linux? ⇒ Boolean
49 50 51 52 |
# File 'lib/j1/utils/platforms.rb', line 49 def linux? RbConfig::CONFIG["host_os"] =~ %r!linux! && \ proc_version !~ %r!microsoft!i end |
#vanilla_windows? ⇒ Boolean Also known as: really_windows?
– Allows you to detect “real” Windows, or what we would consider “real” Windows. That is, that we can pass the basic test and the /proc/version returns nothing to us. –
22 23 24 25 |
# File 'lib/j1/utils/platforms.rb', line 22 def vanilla_windows? RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \ !proc_version end |
#windows? ⇒ Boolean
43 44 45 |
# File 'lib/j1/utils/platforms.rb', line 43 def windows? vanilla_windows? || bash_on_windows? end |