Class: Kitchen::LifecycleHooks
- Inherits:
-
Object
- Object
- Kitchen::LifecycleHooks
- Includes:
- Configurable, Logging, ShellOut
- Defined in:
- lib/kitchen/lifecycle_hooks.rb
Overview
A helper object used by Instance to coordinate lifecycle hook calls from
the lifecycle:
configuration section.
Instance Attribute Summary
Attributes included from Configurable
Instance Method Summary collapse
-
#initialize(config) ⇒ LifecycleHooks
constructor
A new instance of LifecycleHooks.
-
#run_with_hooks(phase, state_file, &block) ⇒ void
Run a lifecycle phase with the pre and post hooks.
Methods included from ShellOut
Methods included from Logging
#banner, #debug, #error, #fatal, #info, #warn
Methods included from Configurable
#[], #bourne_shell?, #calculate_path, #config_keys, #diagnose, #diagnose_plugin, #finalize_config!, included, #name, #powershell_shell?, #remote_path_join, #unix_os?, #verify_dependencies, #windows_os?
Constructor Details
#initialize(config) ⇒ LifecycleHooks
Returns a new instance of LifecycleHooks.
33 34 35 |
# File 'lib/kitchen/lifecycle_hooks.rb', line 33 def initialize(config) init_config(config) end |
Instance Method Details
#run_with_hooks(phase, state_file, &block) ⇒ void
This method returns an undefined value.
Run a lifecycle phase with the pre and post hooks.
43 44 45 46 47 |
# File 'lib/kitchen/lifecycle_hooks.rb', line 43 def run_with_hooks(phase, state_file, &block) run(instance, phase, state_file, :pre) yield run(instance, phase, state_file, :post) end |