class Puppet::FileServing::Mount::Plugins
Find files in the modules' plugins directories. This is a very strange mount because it merges many directories into one.
Public Instance Methods
find(relative_path, request)
click to toggle source
Return an instance of the appropriate class.
# File lib/puppet/file_serving/mount/plugins.rb 8 def find(relative_path, request) 9 mod = request.environment.modules.find { |m| m.plugin(relative_path) } 10 return nil unless mod 11 12 path = mod.plugin(relative_path) 13 14 path 15 end
search(relative_path, request)
click to toggle source
# File lib/puppet/file_serving/mount/plugins.rb 17 def search(relative_path, request) 18 # We currently only support one kind of search on plugins - return 19 # them all. 20 paths = request.environment.modules.find_all { |mod| mod.plugins? }.collect { |mod| mod.plugin_directory } 21 if paths.empty? 22 # If the modulepath is valid then we still need to return a valid root 23 # directory for the search, but make sure nothing inside it is 24 # returned. 25 request.options[:recurse] = false 26 request.environment.modulepath.empty? ? [Puppet[:codedir]] : request.environment.modulepath 27 else 28 paths 29 end 30 end
valid?()
click to toggle source
# File lib/puppet/file_serving/mount/plugins.rb 32 def valid? 33 true 34 end