Class | SysInfo |
In: |
lib/sysinfo.rb
|
Parent: | Storable |
VERSION | = | "0.8.0".freeze |
IMPLEMENTATIONS | = | [ # These are for JRuby, System.getproperty('os.name'). # For a list of all values, see: http://lopica.sourceforge.net/os.html #regexp matcher os implementation [/mac\s*os\s*x/i, :unix, :osx ], [/sunos/i, :unix, :solaris ], [/windows\s*ce/i, :windows, :wince ], [/windows/i, :windows, :windows ], [/osx/i, :unix, :osx ], # These are for RUBY_PLATFORM and JRuby [/java/i, :java, :java ], [/darwin/i, :unix, :osx ], [/linux/i, :unix, :linux ], [/freebsd/i, :unix, :freebsd ], [/netbsd/i, :unix, :netbsd ], [/solaris/i, :unix, :solaris ], [/irix/i, :unix, :irix ], [/cygwin/i, :unix, :cygwin ], [/mswin/i, :windows, :windows ], [/djgpp/i, :windows, :djgpp ], [/mingw/i, :windows, :mingw ], [/bccwin/i, :windows, :bccwin ], [/wince/i, :windows, :wince ], [/vms/i, :vms, :vms ], [/os2/i, :os2, :os2 ], [nil, :unknown, :unknown ], ].freeze |
ARCHITECTURES | = | [ [/(i\d86)/i, :x86 ], [/x86_64/i, :x86_64 ], [/x86/i, :x86 ], # JRuby [/ia64/i, :ia64 ], [/alpha/i, :alpha ], [/sparc/i, :sparc ], [/mips/i, :mips ], [/powerpc/i, :powerpc ], [/universal/i,:x86_64 ], [nil, :unknown ], ].freeze |
impl | -> | implementation |
arch | -> | architecture |
Return the local IP address which receives external traffic from: coderrr.wordpress.com/2008/05/28/get-your-local-ip-address/ NOTE: This does not open a connection to the IP address.
Returns the local uptime in hours. Use Win32API in Windows, ‘sysctl -b kern.boottime’ os osx, and ‘who -b’ on unix. Based on Ruby Quiz solutions by: Matthias Reitinger On Windows, see also: net statistics server
Returns a String of the full platform descriptor in the format: VM-OS-IMPL-ARCH e.g. java-unix-osx-x86_64