Module: LinuxUtilinfo::HardwareMethods
- Included in:
- LinuxUtilinfo
- Defined in:
- lib/linux_utilinfo/hardware_methods.rb
Instance Method Summary collapse
- #get_bios_vendor ⇒ Object
- #get_dimensions ⇒ Object
- #get_model ⇒ Object
- #get_number_of_cores ⇒ Object
- #get_processor ⇒ Object
Instance Method Details
#get_bios_vendor ⇒ Object
9 10 11 12 |
# File 'lib/linux_utilinfo/hardware_methods.rb', line 9 def get_bios_vendor bios_vendor = `cat /sys/devices/virtual/dmi/id/bios_vendor` return bios_vendor end |
#get_dimensions ⇒ Object
24 25 26 27 |
# File 'lib/linux_utilinfo/hardware_methods.rb', line 24 def get_dimensions dimensions = `xdpyinfo | grep 'dimensions:' | cut -d ':' -f2` return dimensions end |
#get_model ⇒ Object
14 15 16 17 |
# File 'lib/linux_utilinfo/hardware_methods.rb', line 14 def get_model product_model = `cat /sys/devices/virtual/dmi/id/product_name` return product_model end |
#get_number_of_cores ⇒ Object
19 20 21 22 |
# File 'lib/linux_utilinfo/hardware_methods.rb', line 19 def get_number_of_cores core_number = `grep -c '^processor' /proc/cpuinfo` return core_number end |
#get_processor ⇒ Object
3 4 5 6 7 |
# File 'lib/linux_utilinfo/hardware_methods.rb', line 3 def get_processor processor_name = `cat /proc/cpuinfo | grep -m 1 -i 'model name' | cut -d ':' -f2` processor_name.strip! return processor_name end |