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)

Instance Method Details

- (Object) after_cycle

Overwrite to add actions after the reload rotation has ended.



182
# File 'lib/ramaze/reloader.rb', line 182

def after_cycle; end

- (Object) after_safe_load(file)

Overwrite to add custom hook in addition to default Cache cleaning



198
199
# File 'lib/ramaze/reloader.rb', line 198

def after_safe_load(file)
end

- (Object) after_safe_load_failed(file, error)

Overwrite to add actions after a file is Kernel::load-ed unsuccessfully, by default we output an error-message with the exception.



203
204
205
# File 'lib/ramaze/reloader.rb', line 203

def after_safe_load_failed(file, error)
  Log.error(error)
end

- (Object) after_safe_load_succeed(file)

Overwrite to add actions after a file is Kernel::load-ed successfully, by default we clean the Cache for compiled templates and resolved actions.



192
193
194
195
# File 'lib/ramaze/reloader.rb', line 192

def after_safe_load_succeed(file)
  Cache.clear_after_reload
  after_safe_load(file)
end

- (Object) before_cycle

Overwrite to add actions before the reload rotation is started.



179
# File 'lib/ramaze/reloader.rb', line 179

def before_cycle; end

- (Object) before_safe_load(file)

Overwrite to add actions before a file is Kernel::load-ed



185
186
187
# File 'lib/ramaze/reloader.rb', line 185

def before_safe_load(file)
  Log.debug("reload #{file}")
end