/usr/share/perl5/Bread/Board/Dumper.pm is in libbread-board-perl 0.29-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 95 96 97 98 99 100 101 102 103 104 105 106 | package Bread::Board::Dumper;
BEGIN {
$Bread::Board::Dumper::AUTHORITY = 'cpan:STEVAN';
}
{
$Bread::Board::Dumper::VERSION = '0.29';
}
use Moose;
sub dump {
my ($self, $thing, $indent) = @_;
$indent = defined $indent ? $indent . ' ' : '';
my $output = '';
if ($thing->isa('Bread::Board::Dependency')) {
$output .= join('', $indent, "depends_on: ", $thing->service_path || $thing->service->name, "\n");
}
elsif ($thing->does('Bread::Board::Service')) {
$output .= join('', $indent, "service: ", $thing->name, "\n" );
if ($thing->does('Bread::Board::Service::WithDependencies')) {
while (my($key, $value) = each %{ $thing->dependencies }) {
$output .= $self->dump($value, $indent);
}
}
}
elsif ($thing->isa('Bread::Board::Container')) {
$output = join('', $indent, "container: ", $thing->name, "\n" );
my ($key, $value);
while (($key, $value) = each %{ $thing->sub_containers }) {
$output .= $self->dump($value, $indent);
}
while (($key, $value) = each %{ $thing->services }) {
$output .= $self->dump($value, $indent);
}
}
return $output;
}
__PACKAGE__->meta->make_immutable;
no Moose; 1;
__END__
=pod
=head1 NAME
Bread::Board::Dumper
=head1 VERSION
version 0.29
=head1 SYNOPSIS
use Bread::Board::Dumper;
print Bread::Board::Dumper->new->dump($container);
# container: Application
# container: Controller
# container: View
# service: TT
# depends_on: include_path
# container: Model
# service: dsn
# service: schema
# depends_on: pass
# depends_on: ../dsn
# depends_on: user
=head1 DESCRIPTION
This is a useful utility for dumping a clean view of a Bread::Board
container.
=head1 AUTHOR (actual)
Daisuke Maki
=head1 BUGS
All complex software has bugs lurking in it, and this module is no
exception. If you find a bug please either email me, or add the bug
to cpan-RT.
=head1 AUTHOR
Stevan Little <stevan@iinteractive.com>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Infinity Interactive.
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
|