Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: e59d5b0487
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 29 lines (24 sloc) 0.684 kb
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
package Angelos::Debug::Components;
use Mouse::Role;
use Text::SimpleTable;
with 'Angelos::Debug';

around 'setup_components' => sub {
    my ( $next, $self ) = @_;
    my $components = $self->$next();
    $self->__show_components($components);
    return $components;
};

sub __show_components {
    my ( $self, $components ) = @_;
    my $report = $self->__make_components_report($components);
    $self->log_message($report);
}

sub __make_components_report {
    my ( $self, $components ) = @_;
    my $t = Text::SimpleTable->new( [ 63, 'Class' ] );
    for my $comp ( sort keys %{$components} ) {
        $t->row($comp);
    }
    "Loaded components:\n" . $t->draw . "\n";
}

1;
Something went wrong with that request. Please try again.