lib/pdk/util/puppet_strings.rb in pdk-1.14.0 vs lib/pdk/util/puppet_strings.rb in pdk-1.14.1

- old
+ new

@@ -1,5 +1,7 @@ +require 'pdk' + module PDK module Util module PuppetStrings class NoObjectError < StandardError; end class RunError < StandardError; end @@ -87,11 +89,11 @@ # element of each pair is the generator class and the second element of # 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| + generators = PDK::Generate.generators.select do |gen| gen.respond_to?(:puppet_strings_type) && !gen.puppet_strings_type.nil? end known_objects = generate_hash @@ -112,10 +114,10 @@ # PDK::Util::PuppetStrings.find_generator('puppet_classes') # => PDK::Generate::PuppetClass def self.find_generator(type) require 'pdk/generate' - PDK::Generate::GENERATORS.find do |gen| + PDK::Generate.generators.find do |gen| gen.respond_to?(:puppet_strings_type) && gen.puppet_strings_type == type end end end end