/usr/share/perl5/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm is in libdbix-class-deploymenthandler-perl 0.002208-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | package DBIx::Class::DeploymentHandler::WithApplicatorDumple;
{
$DBIx::Class::DeploymentHandler::WithApplicatorDumple::VERSION = '0.002208';
}
use MooseX::Role::Parameterized;
use Class::MOP;
use namespace::autoclean;
# this is at least a little ghetto and not super well
# thought out. Take a look at the following at some
# point to clean it all up:
#
# http://search.cpan.org/~jjnapiork/MooseX-Role-BuildInstanceOf-0.06/lib/MooseX/Role/BuildInstanceOf.pm
# http://github.com/rjbs/role-subsystem/blob/master/lib/Role/Subsystem.pm
parameter interface_role => (
isa => 'Str',
required => 1,
);
parameter class_name => (
isa => 'Str',
required => 1,
);
parameter delegate_name => (
isa => 'Str',
required => 1,
);
parameter attributes_to_copy => (
isa => 'ArrayRef[Str]',
default => sub {[]},
);
parameter attributes_to_assume => (
isa => 'ArrayRef[Str]',
default => sub {[]},
);
role {
my $p = shift;
my $class_name = $p->class_name;
Class::MOP::load_class($class_name);
my $meta = Class::MOP::class_of($class_name);
has $_->name => %{ $_->clone }
for grep { $_ } map $meta->find_attribute_by_name($_), @{ $p->attributes_to_copy };
has $p->delegate_name => (
is => 'ro',
lazy_build => 1,
does => $p->interface_role,
handles => $p->interface_role,
);
method '_build_'.$p->delegate_name => sub {
my $self = shift;
$class_name->new({
map { $_ => $self->$_ }
@{ $p->attributes_to_assume },
@{ $p->attributes_to_copy },
})
};
};
1;
# vim: ts=2 sw=2 expandtab
__END__
=pod
=head1 NAME
DBIx::Class::DeploymentHandler::WithApplicatorDumple
=head1 AUTHOR
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Arthur Axel "fREW" Schmidt.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|