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