HomePhorge

(#6978) Add before and after decorators to actions from options.
dca1f077dd7aUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#6978) Add before and after decorators to actions from options.

Options can now add before_action and after_action blocks; these are invoked
before or after any action is invoked on the face. This allows these options
to declare common behaviour and have it automatically applied to the actions
invoked.

Option hooks have no defined order of invocation: they will run in a
completely random order. Where there are dependencies they should be on the
value of the options hash passed to the invocation, not on side-effects of the
other invocations.

You are not able to influence the arguments, options, or calling of the action
body in a before or after decorator. This is by design.

The invocation passes to the hook:

  1. The action object representing this action.
  2. The arguments to the action, as an array.
  3. The options for the action, as a hash.

Paired-With: Max Martin <max@puppetlabs.com>

Details

Provenance
Daniel Pittman <daniel@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU0c60aa28d2d1: maint: delete an empty describe block containing no tests.
Branches
Unknown
Tags
Unknown

Event Timeline

Daniel Pittman <daniel@puppetlabs.com> committed rPUdca1f077dd7a: (#6978) Add before and after decorators to actions from options. (authored by Daniel Pittman <daniel@puppetlabs.com>).Apr 16 2011, 12:14 AM