Class: Puppet::Plugins::DataProviders::FileBasedDataProviderFactory Abstract Private
- Inherits:
-
PathBasedDataProviderFactory
- Object
- PathBasedDataProviderFactory
- Puppet::Plugins::DataProviders::FileBasedDataProviderFactory
- Defined in:
- lib/puppet/plugins/data_providers/data_provider.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
This class is abstract.
Factory for creating file based data providers. This is an extension of the path based factory where it is required that each resolved path appoints an existing file in the local file system.
Direct Known Subclasses
DataProviders::JsonDataProviderFactory, DataProviders::YamlDataProviderFactory
Instance Method Summary collapse
-
#resolve_paths(datadir, declared_paths, paths, lookup_invocation) ⇒ Array<ResolvedPath>
private
Array of resolved paths.
Methods inherited from PathBasedDataProviderFactory
Instance Method Details
#resolve_paths(datadir, declared_paths, paths, lookup_invocation) ⇒ Array<ResolvedPath>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Array of resolved paths.
298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/puppet/plugins/data_providers/data_provider.rb', line 298 def resolve_paths(datadir, declared_paths, paths, lookup_invocation) resolved_paths = [] unless paths.nil? || datadir.nil? ext = path_extension paths.each_with_index do |path, idx| path = path + ext unless path.end_with?(ext) resolved_paths << ResolvedPath.new(declared_paths[idx], datadir + path) end end resolved_paths end |