Module: Ronin::Core::CLI::Printing::OS

Defined in:
lib/ronin/core/cli/printing/os.rb

Overview

Helper methods for printing Operating System (OS) names.

Constant Summary collapse

OS_NAMES =

Mapping of Operating System (OS) IDs to printable names.

{
  unix:  'UNIX',

  bsd:     'BSD',
  freebsd: 'FreeBSD',
  openbsd: 'OpenBSD',
  netbsd:  'NetBSD',

  linux:   'Linux',
  macos:   'macOS',
  windows: 'Windows'
}

Instance Method Summary collapse

Instance Method Details

#os_name(os) ⇒ String

Converts the Operating System (OS) ID to a printable name.

Parameters:

  • os (Symbol)

    The OS ID.

Returns:

  • (String)

    The display name for the OS ID.



50
51
52
# File 'lib/ronin/core/cli/printing/os.rb', line 50

def os_name(os)
  OS_NAMES.fetch(os,&:to_s)
end