Sha256: 1ba1b8f8bb0d329e5866b7ac37113e5824185733393063a43700982d91a8f54c
Contents?: true
Size: 1.07 KB
Versions: 14
Compression:
Stored size: 1.07 KB
Contents
require_relative 'resource_base_generator' require_relative 'serializers/rspec_dumper' require 'puppet' require 'puppet/pops' module Retrospec module Puppet module Generators class DefinitionGenerator < Retrospec::Puppet::Generators::ResourceBaseGenerator # retrospec will initilalize this class so its up to you # to set any additional variables you need to get the job done. def initialize(module_path, spec_object = {}) super @singular_name = 'define' @plural_name = 'defines' end def spec_template_file 'definition_spec.rb.retrospec.erb' end def self.generate_spec_files(module_path, config_data) files = [] manifest_files(module_path).each do |file| definition = new(module_path, config_data.merge({:manifest_file => file})) next unless definition.resource_type == ::Puppet::Pops::Model::ResourceTypeDefinition files << definition.generate_spec_file end files end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems