(#6749) add a shim around the action implementation.
To present a pleasant Ruby API to folks invoking actions we want to have
default values for the trailing 'options' argument, and to be able to pass a
block to the code to allow yield to work.
Given limitations of Ruby 1.8 regarding blocks, we can't use either of those
because the block slot is bound at declaration time, and you can't give
optional arguments.
To work around this we inject, using eval, a full regular Ruby method into the
final block of code. This can provide the default argument at the end in an
intelligent way (albeit by emulating what the interpreter would do).
This doesn't solve the yield problem, but the same method can pass the block
explicitly, and allows other hooks to be injected, which makes it easier to do
smarter things in future...
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>