diff --git a/lib/ohai/config.rb b/lib/ohai/config.rb index e617ecbbd..effcc7595 100644 --- a/lib/ohai/config.rb +++ b/lib/ohai/config.rb @@ -86,8 +86,11 @@ def self.merge_deprecated_config # 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 7d07c5f0d..ccb29c86b 100644 --- a/lib/ohai/plugins/windows/cpu.rb +++ b/lib/ohai/plugins/windows/cpu.rb @@ -54,9 +54,11 @@ 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