Method: PDK::Generate::PuppetClass#target_object_path

Defined in:
lib/pdk/generate/puppet_class.rb

#target_object_pathString

Calculates the path to the .pp file that the new class will be written to.

Returns:

  • (String)

    the path where the new class will be written.



22
23
24
25
26
27
28
29
# File 'lib/pdk/generate/puppet_class.rb', line 22

def target_object_path
  @target_pp_path ||= begin
    class_name_parts = object_name.split('::')[1..-1]
    class_name_parts << 'init' if class_name_parts.empty?

    "#{File.join(module_dir, 'manifests', *class_name_parts)}.pp"
  end
end