Project

lshw

0.0
No commit activity in last 3 years
No release in over 3 years
A ruby gem for easy access to `lshw -xml` output.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.9
~> 2.12
~> 5.6
~> 10.0
~> 0.30

Runtime

~> 1.6
 Project Readme

Lshw

Build Status Gem Version

A ruby gem for easy access to lshw -xml output.

Installation

Add this line to your application's Gemfile:

gem 'lshw'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lshw

Example

require 'lshw'

f = File.open('lshw-output.xml')
lshw = Lshw::XML(f)
f.close

# view system disks
lshw.disks.legnth
=> 1
lshw.disks.first.vendor
=> "DELL"

lshw.disks.first.serial
=> "0092ba6d94a166641b00f667d320b782"

# cpu information
lshw.cpus.length
=> 2

lshw.cpus.first.bits
=> 64

# ram
lshw.memory.size
=> 137438953472

lshw.memory.banks.first.size
=> 17179869184

lshw.memory.banks.first.description
=> "DIMM DDR3 Synchronous 1866 MHz (0.5 ns)"