Class: System

Inherits:
Object
  • Object
show all
Defined in:
lib/system.rb,
lib/system/os.rb,
lib/system/cpu.rb,
lib/system/ruby.rb,
lib/system/backwards_compatibility.rb

Overview

System is a cross-platform and cross-implementation interface to gather system information from the current host.

System offers a simple to use interface to gather an array of information including; OS, CPU, Filesystem, etc..

Since:

  • 0.1.0

Defined Under Namespace

Modules: OS, Ruby Classes: CPU

Class Method Summary collapse

Class Method Details

.java?TrueClass, FalseClass

Deprecated.

0.2.0

Check if Ruby is using Java.

Delegates to System::Ruby.java? for backwards compatibility with 0.1.0.

Returns:

  • (TrueClass, FalseClass)

    Is the current Ruby implementation using Java?

Since:

  • 0.1.0



25
26
27
# File 'lib/system/backwards_compatibility.rb', line 25

def java?
  System::Ruby.java?
end

.jruby?TrueClass, FalseClass

Deprecated.

0.2.0

Check if Ruby is JRuby.

Delegates to System::Ruby.jruby? for backwards compatibility with 0.1.0.

Returns:

  • (TrueClass, FalseClass)

    Is the current Ruby implementation JRuby?

Since:

  • 0.1.0



36
37
38
# File 'lib/system/backwards_compatibility.rb', line 36

def jruby?
  System::Ruby.jruby?
end

.osSymbol Also known as: operating_system

Deprecated.

0.2.0

Get the name of the operating system running on the current host.

Delegates to System::OS.name for backwards compatibility with 0.1.0.

Returns:

  • (Symbol)

    The name of the operating system.

Since:

  • 0.1.0



13
14
15
# File 'lib/system/backwards_compatibility.rb', line 13

def os
  System::OS.name
end