lib/pdk/util/puppet_strings.rb in pdk-1.17.0 vs lib/pdk/util/puppet_strings.rb in pdk-1.18.0

- old
+ new

@@ -90,16 +90,16 @@ # each pair is an array of description hashes from puppet-strings. def self.all_objects require 'pdk/generate' generators = PDK::Generate.generators.select do |gen| - gen.respond_to?(:puppet_strings_type) && !gen.puppet_strings_type.nil? + gen.const_defined?(:PUPPET_STRINGS_TYPE) && !gen::PUPPET_STRINGS_TYPE.nil? end known_objects = generate_hash - generators.map { |gen| [gen, known_objects[gen.puppet_strings_type]] }.reject do |_, obj| + generators.map { |gen| [gen, known_objects[gen::PUPPET_STRINGS_TYPE]] }.reject do |_, obj| obj.nil? || obj.empty? end end # Evaluates the mapping of puppet-strings object type to PDK generator @@ -115,10 +115,10 @@ # => PDK::Generate::PuppetClass def self.find_generator(type) require 'pdk/generate' PDK::Generate.generators.find do |gen| - gen.respond_to?(:puppet_strings_type) && gen.puppet_strings_type == type + gen.const_defined?(:PUPPET_STRINGS_TYPE) && gen::PUPPET_STRINGS_TYPE == type end end end end end