File Coverage

blib/lib/DBIx/Changeset/App/Command/applied.pm
Criterion Covered Total %
statement 19 33 57.5
branch 0 6 0.0
condition 0 6 0.0
subroutine 7 10 70.0
pod 3 3 100.0
total 29 58 50.0


line stmt bran cond sub pod time code
1             package DBIx::Changeset::App::Command::applied;
2              
3 2     2   7310 use warnings;
  2         4  
  2         59  
4 2     2   11 use strict;
  2         2  
  2         85  
5              
6 2     2   10 use base qw/DBIx::Changeset::App::BaseCommand/;
  2         3  
  2         788  
7 2     2   784 use DBIx::Changeset::History;
  2         7  
  2         17  
8 2     2   81 use DBIx::Changeset::Exception;
  2         4  
  2         47  
9              
10 2     2   9 use vars qw{$VERSION};
  2         6  
  2         89  
11             BEGIN {
12 2     2   742 $VERSION = '1.11';
13             }
14              
15             =head1 NAME
16              
17             DBIx::Changeset::App::Command::applied - show the changeset history record db
18              
19             =head1 SYNOPSIS
20              
21             =head1 METHODS
22              
23             =head2 run
24              
25             =cut
26             sub run {
27 0     0 1   my ($self, $opt, $args) = @_;
28              
29 0           my $hrec = DBIx::Changeset::History->new({
30             history_db_dsn => $opt->{'history_db_dsn'},
31             history_db_user => $opt->{'history_db_user'},
32             history_db_password => $opt->{'history_db_password'},
33             });
34              
35 0           my $e;
36 0 0         if ( $e = Exception::Class->caught() ) {
37 0           warn $e->error, "\n";
38 0 0         warn $e->trace->as_string, "\n" if defined $opt->{'debug'};
39 0           exit;
40             }
41              
42 0           print "Bootstrap complete.\n";
43              
44 0           return;
45             }
46              
47             =head2 options
48              
49             define the options for the create command
50              
51             =cut
52              
53             sub options {
54 0     0 1   my ($self, $app) = @_;
55             return (
56 0   0       [ 'history_db_dsn=s' => 'DBI DSN for the history db', { default => $app->{'config'}->{'history_db_dsn'} || $app->{'config'}->{'applied'}->{'history_db_dsn'} || undef, required => 1 } ],
      0        
      0        
57             [ 'history_db_user=s' => 'db user for history db', { default => $app->{'config'}->{'history_db_user'} || $app->{'config'}->{'applied'}->{'history_db_user'} || undef } ],
58             [ 'history_db_password=s' => 'db password for the history db user', { default => $app->{'config'}->{'history_db_password'} || $app->{'config'}->{'update'}->{'history_db_password'} || undef } ],
59             );
60             }
61              
62             =head2 validate
63              
64             define the options validation for the compare command
65              
66             =cut
67              
68             sub validate {
69 0     0 1   my ($self,$opt,$args) = @_;
70 0 0         $self->usage_error('This command requires a history_db_dsn') unless (defined $opt->{'history_db_dsn'});
71 0           return;
72             }
73              
74             =head1 COPYRIGHT & LICENSE
75              
76             Copyright 2004-2008 Grox Pty Ltd.
77              
78             This program is free software; you can redistribute it and/or modify it
79             under the same terms as Perl itself.
80              
81             The full text of the license can be found in the LICENSE file included with this module.
82              
83             =cut
84              
85             1; # End of DBIx::Changeset