Skip to content

Instantly share code, notes, and snippets.

@redivy
Created March 16, 2010 10:40
Show Gist options
  • Save redivy/333836 to your computer and use it in GitHub Desktop.
Save redivy/333836 to your computer and use it in GitHub Desktop.
--- ohai.0.5.platform.rb 2010-03-16 13:31:56.000000000 +0300
+++ /usr/lib64/ruby/gems/1.8/gems/ohai-0.5.0/lib/ohai/plugins/linux/platform.rb 2010-03-16 13:38:21.000000000 +0300
@@ -42,7 +42,7 @@
platform_version IO.read('/etc/gentoo-release').scan(/(\d+|\.+)/).join
elsif File.exists?('/etc/SuSE-release')
platform "suse"
- platform_version IO.read('/etc/SuSE-release').scan(/\d+\.\d+/)[0]
+ platform_version IO.read('/etc/SuSE-release').scan(/version\D+([\d\.]+)\s+patchlevel\D+([\d\.]+)/i).join('.')
elsif File.exists?('/etc/arch-release')
platform "arch"
# no way to determine platform_version in a rolling release distribution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment