Class: Puppet::Pops::Loader::LoaderPaths::PlanPathPP

Inherits:
PuppetSmartPath show all
Defined in:
lib/puppet/pops/loader/loader_paths.rb

Constant Summary collapse

PLAN_PATH_PP =
File.join('plans')

Constants inherited from PuppetSmartPath

Puppet::Pops::Loader::LoaderPaths::PuppetSmartPath::EXTENSION

Instance Attribute Summary

Attributes inherited from SmartPath

#generic_path

Instance Method Summary collapse

Methods inherited from PuppetSmartPath

#effective_path, #extension

Methods inherited from SmartPath

#effective_path, #fuzzy_matching?, #initialize, #lib_root?, #root_path, #valid_name?, #valid_path?

Constructor Details

This class inherits a constructor from Puppet::Pops::Loader::LoaderPaths::SmartPath

Instance Method Details

#instantiatorObject



322
323
324
# File 'lib/puppet/pops/loader/loader_paths.rb', line 322

def instantiator()
  Puppet::Pops::Loader::PuppetPlanInstantiator
end

#relative_pathObject



318
319
320
# File 'lib/puppet/pops/loader/loader_paths.rb', line 318

def relative_path
  PLAN_PATH_PP
end

#typed_name(type, name_authority, relative_path, module_name) ⇒ Object



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/puppet/pops/loader/loader_paths.rb', line 326

def typed_name(type, name_authority, relative_path, module_name)
  if relative_path == 'init.pp' && !(module_name.nil? || module_name.empty?)
    TypedName.new(type, module_name, name_authority)
  else
    n = ''
    n << module_name unless module_name.nil?
    unless extension.empty?
      # Remove extension
      relative_path = relative_path[0..-(extension.length+1)]
    end
    relative_path.split('/').each do |segment|
      n << '::' if n.size > 0
      n << segment
    end
    TypedName.new(type, n, name_authority)
  end
end