Method: ComputeUnit::Device#write_hwmon_data

Defined in:
lib/compute_unit/device.rb

#write_hwmon_data(item, value) ⇒ Object

Parameters:

  • item (String)
    • the name of the hwmon file to write to

  • value (String)
    • the value you want to write to the hwmon file



150
151
152
153
154
155
# File 'lib/compute_unit/device.rb', line 150

def write_hwmon_data(item, value)
  File.write(File.join(hwmon_path, item), value)
rescue Errno::EACCES => e
  logger.info(e.message)
  check_for_root
end