lib/pdk/generators/puppet_object.rb
def run
        [target_object_path, target_spec_path].each do |target_file|
          if File.exist?(target_file)
            raise PDK::CLI::FatalError, _("Unable to generate class, '%{file}' already exists.") % { file: target_file }
          end
        end

        with_templates do |template_path, config_hash|
          data = template_data.merge(configs: config_hash)

          render_file(target_object_path, template_path[:object], data)
          render_file(target_spec_path, template_path[:spec], data) if template_path[:spec]
        end
      end
# Check that the target files do not exist, find an appropriate template
# and create the target files from the template. This is the main entry
# point for the class.
#
# @raise [PDK::CLI::FatalError] if the target files already exist.
#
# @api public
Check that the target files do not exist, find an appropriate template
and create the target files from the template. This is the main entry
point for the class.
Check that the target files do not exist find an appropriate template and create the target files from the template . This is the main entry point for the class .
def run
        [target_object_path, target_spec_path].each do |target_file|
          if File.exist?(target_file)
            raise PDK::CLI::FatalError, _("Unable to generate class, '%{file}' already exists.") % { file: target_file }
          end
        end
        with_templates do |template_path, config_hash|
          data = template_data.merge(configs: config_hash)
          render_file(target_object_path, template_path[:object], data)
          render_file(target_spec_path, template_path[:spec], data) if template_path[:spec]
        end
      end
def run [ target_object_path , target_spec_path ] . each do | target_file | if File . exist? ( target_file ) raise PDK :: CLI :: FatalError , _ ( "Unable to generate class, '%{file}' already exists." ) % { file : target_file } end end with_templates do | template_path , config_hash | data = template_data . merge ( configs : config_hash ) render_file ( target_object_path , template_path [ :object ] , data ) render_file ( target_spec_path , template_path [ :spec ] , data ) if template_path [ :spec ] end end
Check that the target files do not exist, find an appropriate template
and create the target files from the template.
Check that the target files do not exist find an appropriate template and create the target files from the template .
[PDK::CLI::FatalError] if the target files already exist.
[ PDK :: CLI :: FatalError ] if the target files already exist .
api
None