MooseX::Role::DryRunnable::Attribute - EXPERIMENTAL - attribute to add a Dry Run Capability in some methods
package Foo; use Data::Dumper; use Moose; use MooseX::Role::DryRunnable::Attribute; with 'MooseX::Role::DryRunnable::Base'; has dry_run => (is => 'ro', isa => 'Bool', default => 0); sub bar :dry_it { shift; print "Foo::bar @_\n"; } sub is_dry_run { # required ! shift->dry_run } sub on_dry_run { # required ! my $self = shift; my $method = shift; $self->logger("Dry Run method=$method, args: \n", @_); }
This module can be used in Moose classes who uses the role MooseX::Role::DryRunnable::Base. Provides an Attribute :dry_it. EXPERIMETAL
My idea is put the information about the dry run capability close to the method.
This method export to UNIVERSAL one parameter called dry_it, and it works with MooseX::Role::DryRunnable
Moose::Role, Attribute::Handlers, MooseX::Role::DryRunnable.
There are no known bugs in this module.
Please report problems to Tiago Peczenyj <tiago.peczenyj@gmail.com>, or (preferred) to this package's RT tracker at <bug-MooseX-Role-DryRunnable@rt.cpan.org>.
Tiago Peczenyj <tiago.peczenyj@gmail.com>
To install MooseX::Role::DryRunnable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Role::DryRunnable
CPAN shell
perl -MCPAN -e shell install MooseX::Role::DryRunnable
For more information on module installation, please visit the detailed CPAN module installation guide.