File Coverage

lib/App/Sandy/Command/Variation.pm
Criterion Covered Total %
statement 9 22 40.9
branch 0 4 0.0
condition n/a
subroutine 3 7 42.8
pod 2 3 66.6
total 14 36 38.8


line stmt bran cond sub pod time code
1             package App::Sandy::Command::Variation;
2             # ABSTRACT: variation command class. Manage structural variation database.
3              
4 1     1   497 use App::Sandy::Base 'class';
  1         2  
  1         7  
5 1     1   8 use App::Sandy::DB::Handle::Variation;
  1         3  
  1         27  
6 1     1   6 use Text::ASCIITable;
  1         3  
  1         447  
7              
8             extends 'App::Sandy::CLI::Command';
9              
10             our $VERSION = '0.22'; # VERSION
11              
12             has 'db' => (
13             is => 'ro',
14             isa => 'App::Sandy::DB::Handle::Variation',
15             builder => '_build_db',
16             lazy_build => 1,
17             handles => [qw/insertdb restoredb deletedb make_report retrievedb/]
18             );
19              
20             sub _build_db {
21 0     0     return App::Sandy::DB::Handle::Variation->new;
22             }
23              
24             override 'opt_spec' => sub {
25             super
26             };
27              
28             sub subcommand_map {
29 0     0 0   add => 'App::Sandy::Command::Variation::Add',
30             remove => 'App::Sandy::Command::Variation::Remove',
31             restore => 'App::Sandy::Command::Variation::Restore',
32             dump => 'App::Sandy::Command::Variation::Dump'
33             }
34              
35             sub validate_args {
36 0     0 1   my ($self, $args) = @_;
37 0 0         die "Too many arguments: '@$args'\n" if @$args;
38             }
39              
40             sub execute {
41 0     0 1   my ($self, $opts, $args) = @_;
42              
43 0           my $report_ref = $self->make_report;
44              
45 0 0         if (%$report_ref) {
46 0           my $t1 = Text::ASCIITable->new;
47 0           $t1->setCols('structural variation', 'source', 'provider', 'date');
48              
49 0           for my $structural_variation (sort keys %$report_ref) {
50 0           my $attr = $report_ref->{$structural_variation};
51 0           $t1->addRow($structural_variation, $attr->{source}, $attr->{provider}, $attr->{date});
52             }
53              
54 0           print $t1;
55             }
56             }
57              
58             __END__
59              
60             =pod
61              
62             =encoding UTF-8
63              
64             =head1 NAME
65              
66             App::Sandy::Command::Variation - variation command class. Manage structural variation database.
67              
68             =head1 VERSION
69              
70             version 0.22
71              
72             =head1 SYNOPSIS
73              
74             sandy variation
75             sandy variation [options]
76             sandy variation <command>
77              
78             Options:
79             -h, --help brief help message
80             -u, --man full documentation
81              
82             Commands:
83             add add a new structural variation to database
84             dump dump structural variation from database
85             remove remove an user structural variation from database
86             restore restore the database
87              
88             =head1 DESCRIPTION
89              
90             Manage structural variation database.
91              
92             =head1 AUTHORS
93              
94             =over 4
95              
96             =item *
97              
98             Thiago L. A. Miller <tmiller@mochsl.org.br>
99              
100             =item *
101              
102             J. Leonel Buzzo <lbuzzo@mochsl.org.br>
103              
104             =item *
105              
106             Felipe R. C. dos Santos <fsantos@mochsl.org.br>
107              
108             =item *
109              
110             Helena B. Conceição <hconceicao@mochsl.org.br>
111              
112             =item *
113              
114             Gabriela Guardia <gguardia@mochsl.org.br>
115              
116             =item *
117              
118             Fernanda Orpinelli <forpinelli@mochsl.org.br>
119              
120             =item *
121              
122             Pedro A. F. Galante <pgalante@mochsl.org.br>
123              
124             =back
125              
126             =head1 COPYRIGHT AND LICENSE
127              
128             This software is Copyright (c) 2018 by Teaching and Research Institute from Sírio-Libanês Hospital.
129              
130             This is free software, licensed under:
131              
132             The GNU General Public License, Version 3, June 2007
133              
134             =cut