systeminfo/lib/kernel_info.rb

16 lines
385 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
kernel_info
end
end