A resolver that loads files from the filesystem.
Methods
- #
- C
- E
- F
- N
- T
Attributes
| [R] | path |
Class Public methods
new(path) Link
# File actionview/lib/action_view/template/resolver.rb, line 99 def initialize(path) raise ArgumentError, "path already is a Resolver class" if path.is_a?(Resolver) @unbound_templates = Concurrent::Map.new @path_parser = PathParser.new @path = File.expand_path(path) super() end
Instance Public methods
clear_cache() Link
eager_load_templates(view = nil) Link
# File actionview/lib/action_view/template/resolver.rb, line 113 def eager_load_templates(view = nil) template_glob("**/*").each do |file| unbound = build_unbound_template(file) (@unbound_templates[unbound.virtual_path] ||= []) << unbound unbound.bind_locals([]).send(:compile!, view) if view end end
find(name, prefix = nil, partial = false, details = {}, key = nil, locals = []) Link
# File actionview/lib/action_view/template/resolver.rb, line 165 def find(name, prefix = nil, partial = false, details = {}, key = nil, locals = []) requested_details = key || TemplateDetails::Requested.new(**details) unbound_templates = unbound_templates_for(name, prefix, partial, !!key) unbound_template = find_best_by_details(unbound_templates, requested_details) return unless unbound_template unbound_template.bind_locals(locals) end
find_all(name, prefix = nil, partial = false, details = {}, key = nil, locals = []) Link
# File actionview/lib/action_view/template/resolver.rb, line 156 def find_all(name, prefix = nil, partial = false, details = {}, key = nil, locals = []) requested_details = key || TemplateDetails::Requested.new(**details) unbound_templates = unbound_templates_for(name, prefix, partial, !!key) filter_and_sort_by_details(unbound_templates, requested_details).map do |unbound_template| unbound_template.bind_locals(locals) end end
freeze() Link
# File actionview/lib/action_view/template/resolver.rb, line 121 def freeze @path.freeze @path_parser.freeze @unbound_templates = @unbound_templates.each_pair.to_h unless @unbound_templates.is_a?(::Hash) @unbound_templates.each_value do |unbound_templates| unbound_templates.each(&:freeze) unbound_templates.freeze end @unbound_templates.freeze super end