Method: LinuxStat::Kernel.compiler_version
- Defined in:
- lib/linux_stat/kernel.rb
.compiler_version ⇒ Object
Returns the compiler version used to compile the Linux Kernel.
If the information isn’t available, it will return a frozen empty string.
The output is also cached (memoized) ; as changing the value in runtime is unexpected.
57 58 59 60 61 |
# File 'lib/linux_stat/kernel.rb', line 57 def compiler_version @@compiler_version ||= string.split(/(\(.+?\))/).each(&:strip!) .reject(&:empty?)[2..4].to_a .find { |x| x[/[\d.]+/] }.to_s[/[\d.]+/].to_s.freeze end |