Project

General

Profile

Actions

Feature #16742

open

RbConfig.windows? and RbConfig.host_os

Added by Eregon (Benoit Daloze) almost 4 years ago. Updated almost 4 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:97616]

Description

I think adding these two methods would greatly clarify platform checks:

RbConfig.windows? # obvious, much clearer than RUBY_PLATFORM =~ /(mswin|mingw)/
RbConfig.host_os # same as RbConfig::CONFIG['host_os'], but much shorter

RbConfig::CONFIG['host_os'] is too long and feels like digging in the internals even though it's such a simple thing to query.

For comparison, there is already a RbConfig.ruby method on RbConfig, which helps avoiding the boilerplate to access RbConfig::CONFIG manually.

Thoughts?

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0