class Puppet::Pops::Loader::LoaderPaths::PuppetSmartPath

A PuppetSmartPath is rooted at the loader's directory one level up from what the loader specifies as it path (which is a reference to its 'lib' directory.

Constants

EXTENSION

Public Instance Methods

effective_path(typed_name, start_index_in_name) click to toggle source

Duplication of extension information, but avoids one call

    # File lib/puppet/pops/loader/loader_paths.rb
144 def effective_path(typed_name, start_index_in_name)
145   # Puppet name to path always skips the name-space as that is part of the generic path
146   # i.e. <module>/mymodule/functions/foo.pp is the function mymodule::foo
147   parts = typed_name.name_parts
148   if start_index_in_name > 0
149     return nil if start_index_in_name >= parts.size
150     parts = parts[start_index_in_name..-1]
151   end
152   "#{File.join(generic_path, parts)}#{extension}"
153 end
extension() click to toggle source
    # File lib/puppet/pops/loader/loader_paths.rb
139 def extension
140   EXTENSION
141 end
typed_name(type, name_authority, relative_path, module_name) click to toggle source
    # File lib/puppet/pops/loader/loader_paths.rb
155 def typed_name(type, name_authority, relative_path, module_name)
156   n = String.new
157   n << module_name unless module_name.nil?
158   unless extension.empty?
159     # Remove extension
160     relative_path = relative_path[0..-(extension.length+1)]
161   end
162   relative_path.split('/').each do |segment|
163     n << '::' if n.size > 0
164     n << segment
165   end
166   TypedName.new(type, n, name_authority)
167 end