lib/App/SeismicUnixGui/developer/code/sunix/sunix_package_pod.pm untested

filter: Statementstmt 0.0% 0 / 97 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 12 totaltotal 0.0% 0 / 122 CC 1 SCAR 6.9
CC
1
Cov
0%
get_clear
2.0
get_declare
2.0
get_encapsulated
2.0
CRAP 2.0
1 package App::SeismicUnixGui::developer::code::sunix::sunix_package_pod;
2 use Moose;
3 our $VERSION = '0.0.1';
4  
5 =head2 encapsualted variables
6  
7 =cut
8  
9 my $sunix_package_pod = {
10 _package_name => '',
11 _subroutine_name => '',
12 _sudoc => '',
13 _num_lines => '',
14 _local_variables => '',
15 };
16  
17 =head2 sub get_clear
18  
19 Introducton to clear for
20 my $size = scalar @h_lines;
21 print("sunix_package_pod,clear num_lines,$size\n");
22  
23 =cut
24  
25 sub get_clear {
26 my ($self) = @_;
27 my @h_lines;
28 my $i = 0;
29  
30 $h_lines[$i] = ("\n=head2 sub clear\n\n");
31 $h_lines[ ++$i ] = ("=cut\n\n");
32  
33 # print("sunix_package_pod,clear header\n @h_lines");
34 return ( \@h_lines );
35 }
36  
37  
38 =head2 sub get_declare
39  
40 =cut
41  
42 sub get_declare {
43 my ($self) = @_;
44 my @h_lines;
45 my $i = 0;
46  
47 $h_lines[$i] = ("\n\n=head2 declare variables\n\n");
48 $h_lines[ ++$i ] = ("=cut\n");
49 return ( \@h_lines );
50 }
51  
52  
53 =head2 sub get_encapsulated
54  
55 Introducton to encapsulated for
56 print("sunix_package_pod,get_encapsulated num_lines,$size\n");
57  
58 =cut
59  
60 sub get_encapsulated {
61 my ($self) = @_;
62 my @h_lines;
63 my $i = 0;
64  
65 $h_lines[$i] = ("\n=head2 Encapsulated\n");
66 $h_lines[ ++$i ] = ("hash of private variables\n\n");
67 $h_lines[ ++$i ] = ("=cut\n");
68  
69 # print("sunix_package_pod,get_encapsulated header\n @h_lines");
70 return ( \@h_lines );
71 }
72  
73 =head2 sub get_instantiation
74  
75 =cut
76  
77 sub get_instantiation {
78 my ($self) = @_;
79 my @h_lines;
80 my $i = 0;
81  
82 $h_lines[$i] = ("\n=head2 instantiation of packages\n\n");
83 $h_lines[ ++$i ] = ("=cut\n\n");
84 return ( \@h_lines );
85 }
86  
87 =head2 sub get_use
88  
89 =cut
90  
91 sub get_use {
92 my ($self) = @_;
93 my @h_lines;
94 my $i = 0;
95  
96 $h_lines[$i] = ("\n=head2 Import packages\n\n");
97 $h_lines[ ++$i ] = ("=cut\n\n");
98 return ( \@h_lines );
99 }
100  
101 =head2 sub get_verbose
102  
103 Introducton to verbose for
104 my $size = scalar @h_lines;
105 print("sunix_package_pod,verbose num_lines,$size\n");
106  
107 =cut
108  
109 sub get_verbose {
110 my ($self) = @_;
111 my @h_lines;
112 my $i = 0;
113  
114 $h_lines[$i] = ("\n=head2 sub verbose\n\n");
115 $h_lines[ ++$i ] = ("=cut\n");
116  
117 # print("sunix_package_pod,verbose header\n @h_lines");
118 return ( \@h_lines );
119 }
120  
121 =head2 sub get_V
122  
123 Introducton to V for
124 my $size = scalar @h_lines;
125 print("sunix_package_pod,V num_lines,$size\n");
126  
127 =cut
128  
129 sub get_V {
130 my ($self) = @_;
131 my @h_lines;
132 my $i = 0;
133  
134 $h_lines[$i] = ("\n=head2 sub V\n\n");
135 $h_lines[ ++$i ] = ("=cut\n");
136  
137 # print("sunix_package_pod,V header\n @h_lines");
138 return ( \@h_lines );
139 }
140  
141 =head2 Default perl lines for a subroutine
142  
143  
144 =cut
145  
146 my @lines;
147  
148 $lines[0] = ("\n");
149  
150 =head2 sub sudoc
151  
152 Complete sunix documentation
153  
154 =cut
155  
156 sub sudoc {
157  
158 my ( $self, $aref ) = @_;
159 $sunix_package_pod->{_sudoc} = $aref;
160  
161 #print("package_pod,sudoc,whole @{$sunix_package_pod->{_sudoc}} \n");
162 #$sunix_package_pod->{_num_lines} = scalar (@{$aref});
163  
164 }
165  
166 =head2 sub header
167  
168 Introductory header for each package
169  
170 =cut
171  
172 sub header {
173 my ( $self, $name_aref ) = @_;
174 my ( $first, $last, $i, $name );
175 my @h_lines;
176 $sunix_package_pod->{_package_name} = $name_aref;
177 $name = @{ $sunix_package_pod->{_package_name} }[0];
178 $first = 0;
179 $i = $first;
180 my $length = scalar @{ $sunix_package_pod->{_package_name} };
181  
182 $h_lines[$i] = ("\n\n=head1 DOCUMENTATION\n\n");
183 $h_lines[ ++$i ] = ("=head2 SYNOPSIS\n\n");
184 $h_lines[ ++$i ] = ("PERL PROGRAM NAME: $name\n");
185 $h_lines[ ++$i ] = ("AUTHOR: Juan Lorenzo\n");
186 $h_lines[ ++$i ] = ("DATE: \n");
187 $h_lines[ ++$i ] = ("DESCRIPTION:\n");
188 $h_lines[ ++$i ] = ("Version: \n\n");
189 $h_lines[ ++$i ] = ("=head2 USE\n\n");
190 $h_lines[ ++$i ] = ("=head3 NOTES\n\n");
191 $h_lines[ ++$i ] = ("=head4 Examples\n\n");
192 $h_lines[ ++$i ] = ("=head3 SEISMIC UNIX NOTES\n\n");
193  
194 # print(" start is $i\n");
195 my $start = $i;
196 for ( my $j = 0; $j < ($length); $j++ ) {
197  
198 # print(" i is $i\n");
199 # print("no. lines = $length\n");
200 # print (" @{$sunix_package_pod->{_package_name}} \n");
201  
202 $h_lines[ ++$i ] = ("@{$sunix_package_pod->{_package_name}}[$j]\n");
203  
204 }
205 $h_lines[ ++$i ] = ("=head2 CHANGES and their DATES\n\n");
206 $h_lines[ ++$i ] = ("=cut\n");
207 my $size = scalar @h_lines;
208  
209 # print("sunix_package_pod,num_lines,$size\n");
210 # print("sunix_package_pod,header\n @h_lines");
211  
212 return ( \@h_lines );
213 }
214  
215 =head2 sub subroutine_name
216  
217 print("package_pod,name,@lines\n");
218  
219 =cut
220  
221 sub subroutine_name {
222 my ( $self, $name_aref ) = @_;
223 my ( $first, $last, $i, $sub_name );
224  
225 $sunix_package_pod->{_subroutine_name} = $$name_aref;
226  
227 $first = 1;
228 $i = $first;
229  
230 $lines[$i] = ("=head2 sub $$name_aref \n");
231 $lines[ ++$i ] = ("\n");
232 $lines[ ++$i ] = ("\n");
233 $lines[ ++$i ] = ("=cut\n");
234 }
235  
236 =head2 sub sunix_package_name
237  
238 print("sunix_package_pod,name,@lines\n");
239  
240 =cut
241  
242 sub sunix_package_name {
243 my ( $self, $name_href ) = @_;
244 $sunix_package_pod->{_package_name} = $name_href;
245 return ();
246 }
247  
248 =head2 sub section
249  
250 print("sunix_package_pod,section,@lines\n");
251  
252 =cut
253  
254 sub section {
255 my ($self) = @_;
256 return ( \@lines );
257 }
258  
259 1;