File Coverage

blib/lib/Catalyst/Helper/DBIC/DeploymentHandler.pm
Criterion Covered Total %
statement 10 17 58.8
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 14 23 60.8


line stmt bran cond sub pod time code
1             #
2             # This file is part of Catalyst-Helper-DBIC-DeploymentHandler
3             #
4             # This software is Copyright (c) 2011 by Chris Weyl.
5             #
6             # This is free software, licensed under:
7             #
8             # The GNU Lesser General Public License, Version 2.1, February 1999
9             #
10             package Catalyst::Helper::DBIC::DeploymentHandler;
11             BEGIN {
12 1     1   25866 $Catalyst::Helper::DBIC::DeploymentHandler::AUTHORITY = 'cpan:RSRCHBOY';
13             }
14             {
15             $Catalyst::Helper::DBIC::DeploymentHandler::VERSION = '0.001';
16             }
17              
18             # ABSTRACT: Create a script/myapp_dbicdh.pl to help manage your DBIC deployments
19              
20 1     1   761 use namespace::autoclean;
  1         44765  
  1         9  
21 1     1   1123 use common::sense;
  1         10  
  1         6  
22              
23 1     1   57 use File::Spec;
  1         2  
  1         182  
24              
25             sub mk_stuff {
26 0     0 0   my ($self, $helper, $args) = @_;
27              
28             #my $app = lc $helper->{app};
29              
30 0           my $base = $helper->{base};
31 0           my $app = lc $helper->{app};
32              
33 0           $app =~ s/::/_/g;
34              
35 0           my $script = File::Spec->catfile($base, 'script', $app.'_dbicdh.pl');
36 0           $helper->render_file('dbicdh', $script);
37 0           chmod 0755, $script;
38             }
39              
40              
41             1;
42              
43              
44              
45              
46             =pod
47              
48             =head1 NAME
49              
50             Catalyst::Helper::DBIC::DeploymentHandler - Create a script/myapp_dbicdh.pl to help manage your DBIC deployments
51              
52             =head1 VERSION
53              
54             version 0.001
55              
56             =head1 SYNOPSIS
57              
58             ./script/myapp_create.pl DBIC::DeploymentHandler
59              
60             =head1 DESCRIPTION
61              
62             This is a Catalyst helper module that builds a
63             L script for you.
64              
65             VERY EARLY CODE: things may yet change, but shouldn't impact older versions
66             (unless you regenerate the script).
67              
68             =head1 TODO
69              
70             Schemas not named MyApp::DB::Schema.
71              
72             Determine the db type automatically
73              
74             =head1 SEE ALSO
75              
76             L, L,
77             L
78              
79             =head1 CODE LINEAGE
80              
81             While I put together this helper module, this code is largely based on the
82             information (and code) in
83             L. Any errors are mine.
84              
85             =head1 AUTHOR
86              
87             Chris Weyl
88              
89             =head1 COPYRIGHT AND LICENSE
90              
91             This software is Copyright (c) 2011 by Chris Weyl.
92              
93             This is free software, licensed under:
94              
95             The GNU Lesser General Public License, Version 2.1, February 1999
96              
97             =cut
98              
99              
100             __DATA__