Socket
Book a DemoInstallSign in
Socket

sysinfo

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sysinfo

0.10.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

SysInfo - v0.10

All your system-independent infoz in one handy class.

SysInfo does a takes a very quick glance at the system it's running on and exposes the results as YAML, JSON, CSV, or TSV. It also determines a platform identifier for the system that takes the form: VM-OS-IMPLEMENTATION-ARCHITECTURE.

Platform Identifier Examples

  • ruby-unix-osx-i386
  • ruby-unix-osx-powerpc
  • ruby-unix-linux-x86_64
  • java-win32-windows-i386
  • java-win32-mingw-i386

For the complete list of operating systems, implementations and architectures that SysInfo is aware of, see:

  • $ sysinfo os
  • $ sysinfo impl
  • $ sysinfo arch

Usage -- Library

sysinfo = SysInfo.new
sysinfo.vm                    # => ruby
sysinfo.os                    # => unix
sysinfo.impl                  # => osx
sysinfo.arch                  # => i386
sysinfo.platform              # => ruby-unix
sysinfo.to_s                  # => ruby-unix-osx-i386

sysinfo.user                  # => delano
sysinfo.home                  # => /Users/delano
sysinfo.uptime                # => 290.429              (hours)
sysinfo.shell                 # => /bin/bash
sysinfo.paths                 # => [/sbin, /bin, /usr/bin, ...]

sysinfo.hostname              # => walter
sysinfo.ipaddress_internal    # => 10.0.1.2
sysinfo.uptime                # => 290.573655656974
sysinfo.ruby                  # => [1,9,1]

Usage -- Executable

$ sysinfo
ruby-unix-osx-i386

$ /usr/jruby/bin/sysinfo
java-unix-osx-x86_64

$ sysinfo -f yaml
:vm: :ruby
:os: :unix
:impl: :osx
...
:shell: :"/bin/bash"
:user: delano

$ sysinfo -f json
{"vm":"ruby","os":"unix","impl":"osx", ..., "shell":"\/bin\/bash","user":"delano"}

$ sysinfo -f csv
ruby,unix,osx, ... /bin/bash,delano

Installation

    $ sudo gem install sysinfo

Prerequisites

  • Ruby 1.9+, 2.6.8+, 3.1.4+, or JRuby 1.2+
  • Storable

FAQs

Package last updated on 05 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.