line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Egg::Helper::Model::FsaveDate; |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt> |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# $Id: FsaveDate.pm 283 2008-02-27 05:27:43Z lushe $ |
6
|
|
|
|
|
|
|
# |
7
|
1
|
|
|
1
|
|
594
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
391
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION= '0.01'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _start_helper { |
13
|
0
|
|
|
0
|
|
|
my($self)= @_; |
14
|
0
|
|
|
|
|
|
my $c= $self->config; |
15
|
0
|
0
|
|
|
|
|
$c->{helper_option}{project_root} || return $self->_helper_help |
16
|
|
|
|
|
|
|
('I want you to start from helper of the project.'); |
17
|
0
|
|
|
|
|
|
my $o= $self->_helper_get_options; |
18
|
0
|
|
0
|
|
|
|
my $version= $self->helper_valid_version_number($o->{version}) || return 0; |
19
|
0
|
|
|
|
|
|
my $param= $self->helper_prepare_param({ |
20
|
|
|
|
|
|
|
module_version=> $version, |
21
|
|
|
|
|
|
|
created=> __PACKAGE__. " v$VERSION", |
22
|
|
|
|
|
|
|
}); |
23
|
0
|
|
|
|
|
|
$self->helper_prepare_param_module |
24
|
|
|
|
|
|
|
($param, $self->project_name, qw/ Model FsaveDate /); |
25
|
0
|
|
|
|
|
|
my $comp_path= $param->{module_output_filepath}= |
26
|
|
|
|
|
|
|
"$param->{output_path}/lib/$param->{module_filepath}"; |
27
|
0
|
0
|
|
|
|
|
-e $comp_path |
28
|
|
|
|
|
|
|
and return $self->_helper_help("'$comp_path' already exists."); |
29
|
0
|
|
|
|
|
|
$self->helper_generate_files( |
30
|
|
|
|
|
|
|
param => $param, |
31
|
|
|
|
|
|
|
chdir => [$param->{output_path}], |
32
|
|
|
|
|
|
|
create_files => [$self->helper_yaml_load(join '', <DATA>)], |
33
|
|
|
|
|
|
|
errors => { unlink=> [$comp_path] }, |
34
|
|
|
|
|
|
|
complete_msg => "\nFsaveDate controller generate is completed.\n\n" |
35
|
|
|
|
|
|
|
. "output path : $comp_path\n\n" |
36
|
|
|
|
|
|
|
); |
37
|
0
|
|
|
|
|
|
$self; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
sub _helper_help { |
40
|
0
|
|
|
0
|
|
|
my $self = shift; |
41
|
0
|
|
0
|
|
|
|
my $msg = shift || ""; |
42
|
0
|
|
|
|
|
|
my $pname= lc $self->project_name; |
43
|
0
|
0
|
|
|
|
|
$msg= "ERROR: ${msg}\n\n" if $msg; |
44
|
0
|
|
|
|
|
|
print <<END_HELP; |
45
|
|
|
|
|
|
|
${msg}% perl ${pname}_helper.pl M::FsaveDate |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
END_HELP |
48
|
0
|
|
|
|
|
|
0; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 NAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Egg::Helper::Model::DBI - Helper who generates controller for model 'FsaveDate'. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 SYNOPSIS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
% cd /path/to/MyApp/bin |
60
|
|
|
|
|
|
|
% ./myapp_helper.pl M::FsaveDate |
61
|
|
|
|
|
|
|
.......... |
62
|
|
|
|
|
|
|
...... |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 DESCRIPTION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
It is a helper who generates the controller to use it with L<Egg::Model::FsaveDate> |
67
|
|
|
|
|
|
|
under the control of the project. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
It starts specifying the Model::FsaveMode mode for the helper script of the |
70
|
|
|
|
|
|
|
project to use it. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
% ./myapp_helper.pl Model::FsaveDate |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Especially, there is no option needing. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 SEE ALSO |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
L<Egg::Release>, |
79
|
|
|
|
|
|
|
L<Egg::Model::FsaveDate>, |
80
|
|
|
|
|
|
|
L<Egg::Model::FsaveDate::Base>, |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 AUTHOR |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Copyright (C) 2008 Bee Flag, Corp. E<lt>L<http://egg.bomcity.com/>E<gt>, All Rights Reserved. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
91
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.6 or, |
92
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
__DATA__ |
98
|
|
|
|
|
|
|
filename: <e.module_output_filepath> |
99
|
|
|
|
|
|
|
value: | |
100
|
|
|
|
|
|
|
package <e.module_distname>; |
101
|
|
|
|
|
|
|
use strict; |
102
|
|
|
|
|
|
|
use warnings; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
our $VERSION= '<e.module_version>'; |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
package <e.module_distname>::handler; |
107
|
|
|
|
|
|
|
use strict; |
108
|
|
|
|
|
|
|
use base qw/ Egg::Model::FsaveDate::Base /; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
__PACKAGE__->config( |
111
|
|
|
|
|
|
|
base_path => <e.project_name>->path_to(qw/ etc FsaveDate /), |
112
|
|
|
|
|
|
|
amount_save => 90, |
113
|
|
|
|
|
|
|
extention => 'txt', |
114
|
|
|
|
|
|
|
); |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
1; |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
__END__ |
119
|
|
|
|
|
|
|
<e.document> |