class ActionView::PathSet
:nodoc:
A LookupContext
will use a PathSet
to store the paths in its context.
set and also perform operations on other PathSet
objects.
operations are defined so that you can search among the paths in this
This class is used to store and access paths in Action View. A number of
= Action View PathSet
:nodoc:
def +(array)
def +(array) PathSet.new(paths + array) end
def _find_all(path, prefixes, args, outside_app)
def _find_all(path, prefixes, args, outside_app) prefixes = [prefixes] if String === prefixes prefixes.each do |prefix| paths.each do |resolver| if outside_app templates = resolver.find_all_anywhere(path, prefix, *args) else templates = resolver.find_all(path, prefix, *args) end return templates unless templates.empty? end end [] end
def compact
def compact PathSet.new paths.compact end
def exists?(path, prefixes, *args)
def exists?(path, prefixes, *args) find_all(path, prefixes, *args).any? end
def find(*args)
def find(*args) find_all(*args).first || raise(MissingTemplate.new(self, *args)) end
def find_all(path, prefixes = [], *args)
def find_all(path, prefixes = [], *args) _find_all path, prefixes, args, false end
def find_file(path, prefixes = [], *args)
def find_file(path, prefixes = [], *args) _find_all(path, prefixes, args, true).first || raise(MissingTemplate.new(self, path, prefixes, *args)) end
def initialize(paths = [])
def initialize(paths = []) @paths = typecast paths end
def initialize_copy(other)
def initialize_copy(other) @paths = other.paths.dup self end
def to_ary
def to_ary paths.dup end
def typecast(paths)
def typecast(paths) paths.map do |path| case path when Pathname, String OptimizedFileSystemResolver.new path.to_s else path end end end