# # Installs hooks to insert MasterView changed-template reparsing # into the Rails request dispatching handler in ActionController::Base. # # Ensures that MasterView output files are always current while running a # Rails application. The :rails_reparse_checking option in the # MasterView configuration should generally be enabled/disabled in conjunction # with Rails class load caching, which is normally off in a development environment # configuration. # # Requires that MasterView templates be parsed at application startup to properly # initialize the mechanism for detecting template changes after application startup. # module ActionController #:nodoc: class Base #:nodoc # Install hook to enable MasterView to detect and automatically reparse # changed templates during Rails request dispatching. alias :process_pre_mv :process #:nodoc: def process(request, response, method = :perform_action, *arguments) #:nodoc: MasterView::TemplateWatcher.check_updated(MasterView::IOMgr.template, MasterView::TemplateFilenamePattern ) do |mio| MasterView::Parser.parse_mio( mio, MasterView::IOMgr.erb ) end process_pre_mv(request, response, method, *arguments) end end end