diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-19 10:12:15 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-19 10:12:15 -0700 |
commit | 4e3d8188399724b1dd98d2087fc373ea91cf2f9f (patch) | |
tree | 22e770b0ce79f76f000f78d2a934ad440340b323 | |
parent | 635e7a3851d567c0049f6a30488edf69751fb465 (diff) | |
download | ohai-4e3d8188399724b1dd98d2087fc373ea91cf2f9f.tar.gz |
fixing Style/MultilineTernaryOperator
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/ohai/config.rb | 7 | ||||
-rw-r--r-- | lib/ohai/plugins/windows/cpu.rb | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/ohai/config.rb b/lib/ohai/config.rb index e617ecbb..effcc759 100644 --- a/lib/ohai/config.rb +++ b/lib/ohai/config.rb @@ -86,8 +86,11 @@ module Ohai # Furthermore, when the top-level config settings are removed we will # need to ensure that Ohai.config[:log_level] can be set by writing # log_level in a configuration file for consistent behavior with chef. - deprecation_warning = [ :log_level, :log_location ].include?(value) ? - option_might_be_deprecated(option) : option_deprecated(option) + deprecation_warning = if [ :log_level, :log_location ].include?(value) + option_might_be_deprecated(option) + else + option_deprecated(option) + end Ohai::Log.warn(deprecation_warning) value end diff --git a/lib/ohai/plugins/windows/cpu.rb b/lib/ohai/plugins/windows/cpu.rb index 7d07c5f0..ccb29c86 100644 --- a/lib/ohai/plugins/windows/cpu.rb +++ b/lib/ohai/plugins/windows/cpu.rb @@ -54,9 +54,11 @@ Ohai.plugin(:CPU) do cpu[current_cpu]["vendor_id"] = processor["manufacturer"] cpu[current_cpu]["family"] = processor["family"].to_s cpu[current_cpu]["model"] = processor["revision"].to_s - cpu[current_cpu]["stepping"] = processor["stepping"].nil? \ - ? processor["description"].match(/Stepping\s+(\d+)/)[1] \ - : processor["stepping"] + cpu[current_cpu]["stepping"] = if processor["stepping"].nil? + processor["description"].match(/Stepping\s+(\d+)/)[1] + else + processor["stepping"] + end cpu[current_cpu]["physical_id"] = processor["deviceid"] cpu[current_cpu]["model_name"] = processor["description"] cpu[current_cpu]["mhz"] = processor["maxclockspeed"].to_s |