Module: Ramaze::Reloader::Hooks
- Included in:
- Ramaze::Reloader
- Defined in:
- lib/ramaze/reloader.rb
Overview
Holds hooks that are called before and after #cycle and #safe_load
Instance Method Summary collapse
-
#after_cycle ⇒ Object
Overwrite to add actions after the reload rotation has ended.
-
#after_safe_load(file) ⇒ Object
Overwrite to add custom hook in addition to default Cache cleaning.
-
#after_safe_load_failed(file, error) ⇒ Object
Overwrite to add actions after a file is Kernel::load-ed unsuccessfully, by default we output an error-message with the exception.
-
#after_safe_load_succeed(file) ⇒ Object
Overwrite to add actions after a file is Kernel::load-ed successfully, by default we clean the Cache for compiled templates and resolved actions.
-
#before_cycle ⇒ Object
Overwrite to add actions before the reload rotation is started.
-
#before_safe_load(file) ⇒ Object
Overwrite to add actions before a file is Kernel::load-ed.
Instance Method Details
#after_cycle ⇒ Object
Overwrite to add actions after the reload rotation has ended.
143 144 |
# File 'lib/ramaze/reloader.rb', line 143 def after_cycle end |
#after_safe_load(file) ⇒ Object
Overwrite to add custom hook in addition to default Cache cleaning
159 160 |
# File 'lib/ramaze/reloader.rb', line 159 def after_safe_load(file) end |
#after_safe_load_failed(file, error) ⇒ Object
Overwrite to add actions after a file is Kernel::load-ed unsuccessfully, by default we output an error-message with the exception.
164 165 166 |
# File 'lib/ramaze/reloader.rb', line 164 def after_safe_load_failed(file, error) Log.error(error) end |
#after_safe_load_succeed(file) ⇒ Object
Overwrite to add actions after a file is Kernel::load-ed successfully, by default we clean the Cache for compiled templates and resolved actions.
153 154 155 156 |
# File 'lib/ramaze/reloader.rb', line 153 def after_safe_load_succeed(file) Cache.clear_after_reload after_safe_load(file) end |
#before_cycle ⇒ Object
Overwrite to add actions before the reload rotation is started.
139 140 |
# File 'lib/ramaze/reloader.rb', line 139 def before_cycle end |