lib/ohai/dsl/plugin/versionvii.rb in ohai-14.2.0 vs lib/ohai/dsl/plugin/versionvii.rb in ohai-14.3.0

- old
+ new

@@ -106,11 +106,11 @@ # @param platform [Symbol] the platform to collect data for # @param other_platforms [Array] additional platforms to collect data for # @param block [block] the actual code to collect data for the specified platforms def self.collect_data(platform = :default, *other_platforms, &block) [platform, other_platforms].flatten.each do |plat| - if data_collector.has_key?(plat) + if data_collector.key?(plat) raise Ohai::Exceptions::IllegalPluginDefinition, "collect_data already defined on platform #{plat}" else data_collector[plat] = block end end @@ -123,12 +123,12 @@ def run_plugin collector = self.class.data_collector platform = collect_os - if collector.has_key?(platform) + if collector.key?(platform) instance_eval(&collector[platform]) - elsif collector.has_key?(:default) + elsif collector.key?(:default) instance_eval(&collector[:default]) else logger.trace("Plugin #{name}: No data to collect. Skipping...") end end