1
require 'puppet/file_serving/mount'
3
# Find files in the modules' plugins directories.
4
# This is a very strange mount because it merges
5
# many directories into one.
6
class Puppet::FileServing::Mount::Plugins < Puppet::FileServing::Mount
7
# Return an instance of the appropriate class.
8
def find(relative_path, request)
9
return nil unless mod = request.environment.modules.find { |mod| mod.plugin(relative_path) }
11
path = mod.plugin(relative_path)
16
def search(relative_path, request)
17
# We currently only support one kind of search on plugins - return
19
paths = request.environment.modules.find_all { |mod| mod.plugins? }.collect { |mod| mod.plugin_directory }
20
return nil if paths.empty?