From cd49b82fb0d1ec87aacc4c648c8a4a0986791627 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 26 Feb 2018 09:43:17 -0800 Subject: Case statement os_lookup Signed-off-by: Tim Smith --- lib/ohai/plugins/kernel.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/ohai/plugins/kernel.rb b/lib/ohai/plugins/kernel.rb index c580da7c..ad9242e6 100644 --- a/lib/ohai/plugins/kernel.rb +++ b/lib/ohai/plugins/kernel.rb @@ -59,15 +59,17 @@ Ohai.plugin(:Kernel) do # windows def os_lookup(sys_type) - return "WINNT" if sys_type == 18 # most likely so first - return "Unknown" if sys_type == 0 - return "Other" if sys_type == 1 - return "MSDOS" if sys_type == 14 - return "WIN3x" if sys_type == 15 - return "WIN95" if sys_type == 16 - return "WIN98" if sys_type == 17 - return "WINCE" if sys_type == 19 - nil + case sys_type + when 18 then "WINNT" # most likely so first + when 0 then "Unknown" + when 1 then "Other" + when 14 then "MSDOS" + when 15 then "WIN3x" + when 16 then "WIN95" + when 17 then "WIN98" + when 19 then "WINCE" + else nil + end end collect_data(:default) do -- cgit v1.2.1