| Egg-Release documentation | Contained in the Egg-Release distribution. |
Egg::Helper::Build::Prototype - Helper who outputs prototype.js
% cd /path/to/MyApp/bin % ./myapp_helper Build::Prototype
It is a helper according to HTML::Prototype to whom the project outputs 'htdocs' below as for 'prototype.js' etc.
The usage only specifies 'Build::Prototype' and the mode for the helper script of the project.
Masatoshi Mizuno <lushe&64;cpan.org>
Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
| Egg-Release documentation | Contained in the Egg-Release distribution. |
package Egg::Helper::Build::Prototype; # # Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt> # # $Id: Prototype.pm 337 2008-05-14 12:30:09Z lushe $ # use strict; use warnings; use File::Spec; use HTML::Prototype; our $VERSION= '3.00'; sub _start_helper { my($self)= @_; my $c= $self->config; my $o= $self->_helper_get_options; return $self->_helper_help() if $o->{help}; my $htdocs= $c->{dir}{htdocs} || $c->{dir}{static} || return $self->_helper_help('I want configuration dir->{htdocs}.'); -e $htdocs || return $self->_helper_help("'$htdocs' is not found."); my $prototype = File::Spec->catfile( $htdocs, 'prototype.js' ); my $controls = File::Spec->catfile( $htdocs, 'controls.js' ); my $dragdrop = File::Spec->catfile( $htdocs, 'dragdrop.js' ); my $complete = <<END_INFO; ... completed. prototype.js : $prototype controls.js : $controls dragdrop.js : $dragdrop END_INFO $self->helper_generate_files( param => {}, chdir => [$c->{root}], complete_msg => $complete, create_files => [ { filename=> $prototype, value=> $HTML::Prototype::prototype }, { filename=> $controls, value=> $HTML::Prototype::controls }, { filename=> $dragdrop, value=> $HTML::Prototype::controls }, ], ); } sub _helper_help { my $self = shift; my $msg = shift || ""; $msg .= "\n\n" if $msg; my $pname= lc $self->project_name; print <<END_HELP; ${msg}% perl ${pname}_helper.pl Plugin::Prototype [-h] END_HELP } 1; __END__