systeminfo/lib/kernel_info.rb

17 lines
459 B
Ruby
Raw Normal View History

2023-09-21 18:03:25 -06:00
# frozen_string_literal: true
class KernelInfo
def self.gather_info
# Initialize an empty hash to store kernel information
kernel_info = {}
# Use `uname` to get the kernel version
uname_output = `uname -r`.strip
kernel_info[:version] = uname_output if uname_output && !uname_output.empty?
# Return the gathered kernel information
2023-09-22 14:10:28 -06:00
File.open('kernel_info.log', 'w') { |f| f.puts(kernel_info.to_json) }
2023-09-21 18:03:25 -06:00
kernel_info
end
end