- Timestamp:
- 01/03/05 13:41:53 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Text/FormBuilder.pm
r50 r52 7 7 use vars qw($VERSION @EXPORT); 8 8 9 $VERSION = '0.0 7';9 $VERSION = '0.08_01'; 10 10 @EXPORT = qw(create_form); 11 11 … … 64 64 # write webpage, script, or module 65 65 if ($destination =~ $MODULE_EXTS) { 66 $parser->write_module($destination );66 $parser->write_module($destination, 1); 67 67 } elsif ($destination =~ $SCRIPT_EXTS) { 68 $parser->write_script($destination );68 $parser->write_script($destination, 1); 69 69 } else { 70 70 $parser->write($destination); … … 439 439 croak '[Text::FormBuilder::write_module] Expecting a package name' unless $package; 440 440 441 # remove a trailing .pm 442 $package =~ s/\.pm$//; 443 ## warn "[Text::FromBuilder::write_module] Removed extra '.pm' from package name\n" if $package =~ s/\.pm$//; 444 441 445 my $form_code = $self->_form_code; 442 446 … … 499 503 # clean up the generated code, if asked 500 504 eval 'use Perl::Tidy'; 501 die "Can't tidy the code: $@" if $@; 502 Perl::Tidy::perltidy(source => \$source_code, destination => $outfile, argv => $TIDY_OPTIONS); 505 unless ($@) { 506 Perl::Tidy::perltidy(source => \$source_code, destination => $outfile, argv => $TIDY_OPTIONS); 507 } else { 508 carp "Can't tidy the code: $@" if $@; 509 # fallback to just writing it as-is 510 open OUT, "> $outfile" or die $!; 511 print OUT $source_code; 512 close OUT; 513 } 503 514 } else { 504 515 # otherwise, just print as is … … 1194 1205 =head1 TODO 1195 1206 1207 Improve the commmand line tools 1208 1196 1209 Allow renaming of the submit button; allow renaming and inclusion of a 1197 1210 reset button 1211 1212 Allow groups to be used in normal field lines something like this: 1213 1214 !group DATE { 1215 month 1216 day 1217 year 1218 } 1219 1220 dob|Your birthday:DATE 1221 1222 Pieces that wouldn't make sense in a group field: size, row/col, options, 1223 validate. These should cause C<build> to emit a warning before ignoring them. 1224 1225 Make the generated modules into subclasses of CGI::FormBuilder 1198 1226 1199 1227 Allow for custom wrappers around the C<form_template>
Note: See TracChangeset
for help on using the changeset viewer.