class FileUpdateChecker
Ruby on Rails 4.1.16
Since v3.0.20FileUpdateChecker specifies the API used by Rails to watch files and control reloading. The API depends on four methods:
-
initializewhich expects two parameters and one block as described below. -
updated?which returns a boolean if there were updates in the filesystem or not. -
executewhich executes the given block on initialization and updates the latest watched files and timestamp. -
execute_if_updatedwhich just executes the block if it was updated.
After initialization, a call to execute_if_updated must execute the block only if there was really a change in the filesystem.
This class is used by Rails to reload the I18n framework whenever they are changed upon a new request.
i18n_reloader = ActiveSupport::FileUpdateChecker.new(paths) do I18n.reload! end ActionDispatch::Reloader.to_prepare do i18n_reloader.execute_if_updated end
Inherits from
Methods (defined here)
- # execute
- # execute_if_updated
- # updated?
- self. new
Private methods
(6)
Implementation detail — not part of the public API.
- # compile_ext
- # compile_glob
- # escape
- # max_mtime
- # updated_at
- # watched
Methods (inherited)
From Object (22)
- # <
- # acts_like?
- # blank?
- # create_fixtures
- # deep_dup
- # destroy
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_json_with_active_support_encoder
- # to_param
- # to_query
- # try
- # try!
- # unescape
- # with_options
- self. table_name_prefix