module Puppet::Pops::Loader::LoaderPaths

Public Class Methods

relative_paths_for_type(type, loader) click to toggle source

Returns an array of SmartPath, each instantiated with a reference to the given loader (for root path resolution and existence checks). The smart paths in the array appear in precedence order. The returned array may be mutated.

   # File lib/puppet/pops/loader/loader_paths.rb
18 def self.relative_paths_for_type(type, loader)
19   result = []
20   case type
21   when :function
22       # Only include support for the loadable items the loader states it can contain
23       if loader.loadables.include?(:func_4x)
24         result << FunctionPath4x.new(loader)
25       end
26       if loader.loadables.include?(:func_4xpp)
27         result << FunctionPathPP.new(loader)
28       end
29       if loader.loadables.include?(:func_3x)
30         result << FunctionPath3x.new(loader)
31       end
32   when :plan
33     result << PlanPath.new(loader)
34   when :task
35     result << TaskPath.new(loader) if Puppet[:tasks] && loader.loadables.include?(:task)
36   when :type
37     result << DataTypePath.new(loader) if loader.loadables.include?(:datatype)
38     result << TypePathPP.new(loader) if loader.loadables.include?(:type_pp)
39   when :resource_type_pp
40     result << ResourceTypeImplPP.new(loader) if loader.loadables.include?(:resource_type_pp)
41   else
42     # unknown types, simply produce an empty result; no paths to check, nothing to find... move along...
43     []
44   end
45   result
46 end