sysinfo / 0.5.1
| Short description: | System-independent infoz in one handy class | |||||
|---|---|---|---|---|---|---|
| Category: | Library/Development | |||||
| Status: | beta | |||||
| Created: | 2009-05-07 22:48:46 GMT | |||||
| Last update: | 2009-05-07 22:48:46 GMT | |||||
| Owner: | delano (Projects of this owner) | |||||
| Homepage: | http://github.com/delano/sysinfo | |||||
| Download: | http://github.com/delano/sysinfo/tarball/sysinfo-0.5.1 | |||||
| License: | BSD-type | |||||
| Dependency: |
|
|||||
| Description: | SysInfo - v0.5All 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:
Usage — Library
sysinfo = SysInfo.new
p sysinfo.vm # => ruby
p sysinfo.os # => unix
p sysinfo.impl # => osx
p sysinfo.arch # => i386
p sysinfo.platform # => ruby-unix
p sysinfo.to_s # => ruby-unix-osx-i386
p sysinfo.user # => delano
p sysinfo.home # => /Users/delano
p sysinfo.uptime # => 290.429 (hours)
p sysinfo.shell # => /bin/bash
p sysinfo.paths # => [/sbin, /bin, /usr/bin, ...]
p sysinfo.hostname # => walter
p sysinfo.ipaddress_internal # => 10.0.1.2
p sysinfo.uptime # => 290.573655656974
p 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
InstallationVia Rubygems, one of:
$ sudo gem install sysinfo
$ sudo gem install delano-sysinfo --source http://gems.github.com/
or via download: Prerequisites
Credits
LicenseSee: LICENSE.txt |
|||||