class Puppet::FileServing::Mount::Locales
Find files in the modules' locales 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/locales.rb 9 def find(relative_path, request) 10 mod = request.environment.modules.find { |m| m.locale(relative_path) } 11 return nil unless mod 12 13 path = mod.locale(relative_path) 14 15 path 16 end
search(relative_path, request)
click to toggle source
# File lib/puppet/file_serving/mount/locales.rb 18 def search(relative_path, request) 19 # We currently only support one kind of search on locales - return 20 # them all. 21 paths = request.environment.modules.find_all { |mod| mod.locales? }.collect { |mod| mod.locale_directory } 22 if paths.empty? 23 # If the modulepath is valid then we still need to return a valid root 24 # directory for the search, but make sure nothing inside it is 25 # returned. 26 request.options[:recurse] = false 27 request.environment.modulepath.empty? ? [Puppet[:codedir]] : request.environment.modulepath 28 else 29 paths 30 end 31 end
valid?()
click to toggle source
# File lib/puppet/file_serving/mount/locales.rb 33 def valid? 34 true 35 end