Method: LinuxStat::OS.lsb_release

Defined in:
lib/linux_stat/os.rb

.lsb_releaseObject

Reads /etc/lsb-release and returns a Hash. For example:

LinuxStat::OS.lsb_release

=> {:LSB_VERSION=>"1.4", :DISTRIB_ID=>"Arch", :DISTRIB_RELEASE=>"rolling", :DISTRIB_DESCRIPTION=>"Arch Linux"}

If the info isn’t available, it will return an empty Hash.

The amount of data read is 4096 bytes. Any more than that will result in truncated output.

The information is also cached, and once loaded, won’t change in runtime. Because changing the /etc/lsb-release isn’t expected in runtime.



39
40
41
# File 'lib/linux_stat/os.rb', line 39

def lsb_release
	@@lsb_release ||= File.readable?('/etc/lsb-release') ? release('/etc/lsb-release') : {}
end