File Coverage

blib/lib/App/bif/show/hub.pm
Criterion Covered Total %
statement 12 22 54.5
branch 0 4 0.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 17 31 54.8


line stmt bran cond sub pod time code
1             package App::bif::show::hub;
2 1     1   4066 use strict;
  1         2  
  1         33  
3 1     1   3 use warnings;
  1         1  
  1         25  
4 1     1   7 use Bif::Mo;
  1         4  
  1         7  
5              
6             our $VERSION = '0.1.5_5';
7             extends 'App::bif::show';
8              
9             sub run {
10 1     1 1 1 my $self = shift;
11 1         3 my $opts = $self->opts;
12 1         5 my $db = $self->db;
13 0 0         my $hub = $self->get_hub( $opts->{id} ? $opts->{id} : $opts->{name} );
14              
15 0           my @data;
16              
17             push(
18             @data,
19             $self->header(
20             ' ID', $hub->{id},
21 0 0         $opts->{full} ? $hub->{uuid} : substr( $hub->{uuid}, 1, 8 )
22             ),
23             );
24              
25 0           push( @data, $self->header( ' Location', $hub->{location}, ) );
26              
27             my $info = $db->xhashref(
28             select => [qw/n.ctime n.ctimetz n.mtime n.mtimetz/],
29             from => 'nodes n',
30             inner_join => 'changes c',
31             on => 'c.id = n.first_change_id',
32             where => { 'n.id' => $hub->{id} },
33 0           );
34              
35 0           $self->start_pager;
36 0           print $self->render_table( 'l l', [ 'Hub', $hub->{name} ], \@data, 1 );
37 0           print "\n";
38              
39 0           $self->new_cmd( 'App::bif::log::hub', opts => { id => $hub->{id} } )->run;
40              
41 0           return $self->ok( 'ShowHub', \@data );
42             }
43              
44             1;
45             __END__