Sha256: 553ffc82be4bad2d09d60990d2b0d733b008f722f8d3e0977b2d2561f16c895a

Contents?: true

Size: 448 Bytes

Versions: 2

Compression:

Stored size: 448 Bytes

Contents

require 'os'
require 'yaml'

module Rsyslibs
  class OperatingSystemInfo
    def self.os_info
      os_report = YAML.safe_load(OS.report)
      {
        os: os_report['target_os'],
        os_vendor: os_report['target_vendor'],
        os_bits: OS.bits,
        ruby_platform: os_report['RUBY_PLATFORM']
      }
    end

    def self.os_name
      return 'MacOS' if OS.mac?

      return 'Linux' if OS.linux?

      'Unknown OS'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rsyslibs-0.3.0 lib/rsyslibs/operating_system_info.rb
rsyslibs-0.2.0 lib/rsyslibs/operating_system_info.rb