- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0 (0)
- 3.0.9 (-2)
- 3.1.0 (0)
- 3.2.1 (38)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (-1)
- 4.1.8 (0)
- 4.2.1 (0)
- 4.2.7 (0)
- 4.2.9 (0)
- 5.0.0.1 (0)
- 5.1.7 (0)
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (2)
- 7.1.3.4 (0)
- What's this?
FileUpdateChecker specifies the API used by Rails to watch files and control reloading. The API depends on four methods:
-
initialize which expects two parameters and one block as described below.
-
updated? which returns a boolean if there were updates in the filesystem or not.
-
execute which executes the given block on initialization and updates the latest watched files and timestamp.
-
execute_if_updated which 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 ActiveSupport::Reloader.to_prepare do i18n_reloader.execute_if_updated end