| Class | ActionView::ReloadableTemplate::ReloadablePath |
| In: |
vendor/rails/actionpack/lib/action_view/reloadable_template.rb
|
| Parent: | Template::Path |
# File vendor/rails/actionpack/lib/action_view/reloadable_template.rb, line 9
9: def initialize(path)
10: super
11: @paths = {}
12: new_request!
13: end
# File vendor/rails/actionpack/lib/action_view/reloadable_template.rb, line 20
20: def [](path)
21: if found_template = @paths[path]
22: begin
23: found_template.reset_cache_if_stale!
24: rescue TemplateDeleted
25: unregister_template(found_template)
26: self[path]
27: end
28: else
29: load_all_templates_from_dir(templates_dir_from_path(path))
30: # don't ever hand out a template without running a stale check
31: (new_template = @paths[path]) && new_template.reset_cache_if_stale!
32: end
33: end