Template
# File lib/action_view/reloadable_template.rb, line 87 def mtime File.mtime(filename) end
# File lib/action_view/reloadable_template.rb, line 100 def reset_cache_if_stale! if stale? flush_cache 'source', 'compiled_source' undef_my_compiled_methods! @previously_last_modified = mtime end self end
# File lib/action_view/reloadable_template.rb, line 93 def stale? previously_last_modified.nil? || previously_last_modified < mtime rescue Errno::ENOENT => e undef_my_compiled_methods! raise TemplateDeleted end
remove any compiled methods that look like they might belong to me
# File lib/action_view/reloadable_template.rb, line 110 def undef_my_compiled_methods! ActionView::Base::CompiledTemplates.public_instance_methods.grep(/#{Regexp.escape(method_name_without_locals)}(?:_locals_)?/).each do |m| ActionView::Base::CompiledTemplates.send(:remove_method, m) end end
Generated with the Darkfish Rdoc Generator 2.