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