From b10077bf99168582ef0205918f60762bf3425d99 Mon Sep 17 00:00:00 2001 From: cedric57 Date: Sun, 1 Jun 2014 18:40:56 +0200 Subject: [PATCH] Update sensors.rb add libsensor version move call to .to_ffi function --- lib/sensors.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/sensors.rb b/lib/sensors.rb index 7a60e3a..e195e57 100644 --- a/lib/sensors.rb +++ b/lib/sensors.rb @@ -39,13 +39,18 @@ def self.initialize (config=nil) def self.chips (match=nil) Enumerator.new do |e| number = FFI::MemoryPointer.new :int - match = Chip.new(match.to_s) if match + match = Chip.new(match.to_s).to_ffi if match - until (chip = C::sensors_get_detected_chips(match.to_ffi, number)).null? + until (chip = C::sensors_get_detected_chips(match, number)).null? e << Chip.new(chip) end end end + + def self.version() + C::libsensors_version + end + end Sensors.initialize