rdp / os

The OS gem allows for some easy telling if you’re on windows or not. OS.windows? as well as some other helper utilities
MIT License
145 stars 33 forks source link

Detecting Centos 7 does not work #42

Closed arohr closed 4 years ago

arohr commented 4 years ago
# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
# cat /etc/centos-release 
CentOS Linux release 7.6.1810 (Core) 
# irb
irb(main):001:0> require 'os'
=> true
irb(main):002:0> OS.parse_os_release
Traceback (most recent call last):
        7: from /usr/local/bin/irb:23:in `<main>'
        6: from /usr/local/bin/irb:23:in `load'
        5: from /usr/local/lib/ruby/gems/2.7.0/gems/irb-1.2.1/exe/irb:11:in `<top (required)>'
        4: from (irb):2
        3: from /usr/local/lib/ruby/gems/2.7.0/gems/os-1.1.0/lib/os.rb:289:in `parse_os_release'
        2: from /usr/local/lib/ruby/gems/2.7.0/gems/os-1.1.0/lib/os.rb:289:in `each_line'
        1: from /usr/local/lib/ruby/gems/2.7.0/gems/os-1.1.0/lib/os.rb:291:in `block in parse_os_release'
NoMethodError (undefined method `to_sym' for nil:NilClass)