Apps/Database/RemoveData.pm

filter: Statementstmt 66.6% 4 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 75.0% 6 / 8 CC 1 SCAR 1.4
CC
1
Cov
67%
BEGIN
1.3
BEGIN
1.0
CRAP 1.1
« Apps/Database/ExtractGlobals.pm ↑ Summary Model/Database.pm »
1 package XAS::Apps::Database::RemoveData;
2  
3 our $VERSION = '0.02';
4  
5 1 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 use XAS::Class
7 0 ▶ version => $VERSION,
Subroutine BEGIN: called CC=1 SCAR=2.6
8 base => 'XAS::Lib::App',
9 accessors => 'file',
10 0 ;
11  
12 # ----------------------------------------------------------------------
13 # Public Methods
14 # ----------------------------------------------------------------------
15  
16 sub parse_file {
17 my $self = shift;
18  
19 my $fh;
20  
21 open($fh, "<", $self->file);
22  
23 LOOP:
24 while (<$fh>) {
25  
26 if ($_ =~ m/^COPY \w+ \(/) {
27  
28 while (<$fh>) {
29  
30 next LOOP if ($_ =~ m/^\\\./);
31  
32 }
33  
34 }
35  
36 print $_;
37  
38 }
39  
40 }
41  
42 sub main {
43 my $self = shift;
44  
45 $self->log->debug('starting main section');
46  
47 $self->parse_file();
48  
49 $self->log->debug('ending main section');
50  
51 }
52  
53 sub options {
54 my $self = shift;
55  
56 $self->{file} = '';
57  
58 return {
59 'file=s' => \$self->{file},
60 };
61  
62 }
63  
64 # ----------------------------------------------------------------------
65 # Private Methods
66 # ----------------------------------------------------------------------
67  
68 1;
69  
70 __END__
« Apps/Database/ExtractGlobals.pm ↑ Summary Model/Database.pm »