NAME

Egg::Helper - Framework of helper script for Egg.

SYNOPSIS

  # The helper script is obtained.
  perl -MEgg::Helper -e "Egg::Helper->out" > /path/to/bin/egg_helper.pl
  
  # Project is generated.
  perl /path/to/bin/egg_helper.pl Project:[PROJECT_NAME]

DESCRIPTION

It is a module that offers the helper function for Egg.

Please make the helper script first of all to use it as follows.

  perl -MEgg::Helper -e "Egg::Helper->out" > /path/to/bin/egg_helper.pl
  chmod 755 /path/to/bin/egg_helper.pl

* Putting on the place that PATH passed is convenient for egg_helper.pl.

Afterwards, please make the project as follows.

  egg_helper.pl Project:MYPROJECT

The directory named MYPROJECT is made from this in the current directory. And, the skeleton for the project is generated in that.

Passing at the output destination can be specified by '-o' option.

  egg_helper.pl Project:MYPROJECT -o /path/to

MYPROJECT is made for the subordinate of /path/to from this.

Passing Perl cannot be acquired according to circumstances and there might be doing the error end. For that case, please set PELR_PATH to the environment variable.

  export PELR_PATH=/usr/bin/perl

A is generated to bin of the made project. The helper only for the project can be used by using this script.

  cd /path/to/MYPROJECT/bin
  ./myproject_helper.pl D:Make NewDispatch

Please see special each helper's document about special helper's use.

METHODS

These are for the developer of the helper script. It is not information necessary for the application making.

global

A global HASH reference is returned.

yaml_load or parse_yaml ([YAML_FILE])

After given YAML is regularized, it returns it.

escape_html ([HTML_TEST])

It escapes in the HTML tag in the text.

escape_html ([PLAIN_TEXT])

It returns it based on escape ending HTML tag in the text.

escape_uri ([URI])

It escapes in the character for which the escape in URI is necessary.

unescape_uri

It returns it based on the escape character in URI.

conv ([PARAM_HASH], [TEXT], [FILE_NAME])

The part of <# param_name #> in [TEXT] is replaced with the value of corresponding [PARAM_HASH].

* The CODE reference can be defined in the value of [PARAM_HASH].

fread or read_file ([FILE_PATH], [PARAM])

The content of the given file is returned.

When the read content is a text, the result of passing conv is returned. The content is returned by the SCALAR reference, except when the content is a text.

When [PARAM] is omitted, global is used.

fwrite or save_file ([PARAM], [FILE_DATA])

The file is made based on information given by [FILE_DATA].

[FILE_DATA] becomes HASH reference with the following keys and the values.

  filename : Generated file PATH.
  value    : Content of generated file.
  filetype : Only bin can be specified.
             When making it to bin, the content given with value is a value of
             the MIME::Base64 encode.
  permission: After the file is generated, a specified permission is set.
  
  * The value of filename and value passes conv.

[PARAM] is HASH reference passed to conv.

is_unix

When operating by system OS UNIX, true is restored.

is_win32

When operating by system OS Windows, true is restored.

is_mac

When operating by system OS MacOS, true is restored.

perl_path

Passing Perl is returned. When it is not possible to acquire it from environment variable PERL_PATH or File::Which, the exception is generated.

project_name

The object project name under execution is returned.

setup_global

A global value of default is set. Because this is called beforehand, it is not necessary to usually call it from the helper module.

get_out_path

Passing at the output destination is returned.

The thing specified by environment variable EGG_OUT_PATH besides specifying it by '-o' option is possible. Anything returns a current passing when there is no specification.

get_cwd

A current now passing is returned.

setup_document_code

It sets it concerning the document of the default put on the module.

chdir ([PATH])

After chdir is done, it reports to a standard output.

copy ([PATH1], [PATH2])

After File::Copy::copy is done, it reports to a standard output.

move ([PATH1], [PATH2])

After File::Copy::move is done, it reports to a standard output.

remove_dir ([PATH])

After File::Path::rmtree is done, it reports to a standard output.

execute_make

If 'is_unix' is true, 'exec_perl_Makefile' is called and if it is false, 'output_manifest' is called.

* Please prepare 'output_manifest'.

distclean_execute_make

If 'is_unix' is true, 'exec_perl_Makefile' is called after make distclean is done and if it is false, 'output_manifest' is called.

* Please prepare 'output_manifest'.

exec_perl_Makefile

Perl Makefile.PL and a series of operation are done.

It is necessary to have moved to the root directory etc. of the project before it calls it.

egg_context

The object of the object project is returned.

* Prepare_component etc. have not gone. Please call it if necessary after it receives it.

load_config

The setting of the object project is returned reading.

It gives priority to that if there is YAML file at the output destination of Egg::Helper::P::YAML.

check_module_name

Whether it is accepted as a module name is checked.

get_testfile_new_number

The last number of the test file of the object project is returned most.

setup_global_rc

The value obtained from Egg::Plugin::YAML->loadrc is set in global.

encode_bin_out ([FILE_PATH])

The result of MIME::Base64::encode_base64 is returned reading the file of [FILE_PATH].

It is convenient so that filetype passed to 'save_file' may make value of bin.

help_message

Help of default is output.

SEE ALSO

Egg::Release,

AUTHOR

Masatoshi Mizuno, <mizuno@bomcity.com>

COPYRIGHT AND LICENSE

Copyright (C) 2007 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

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.