Method: Puppet::Pops::Loader::LoaderPaths::PlanPath#effective_path

Defined in:
lib/puppet/pops/loader/loader_paths.rb

#effective_path(typed_name, start_index_in_name) ⇒ Object



367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/puppet/pops/loader/loader_paths.rb', line 367

def effective_path(typed_name, start_index_in_name)
  # Puppet name to path always skips the name-space as that is part of the generic path
  # i.e. <module>/mymodule/functions/foo.pp is the function mymodule::foo
  parts = typed_name.name_parts
  if start_index_in_name > 0
    return nil if start_index_in_name >= parts.size

    parts = parts[start_index_in_name..]
  end
  basename = File.join(generic_path, parts)
  @extensions.map { |ext| "#{basename}#{ext}" }
end