Module::New::Recipe::File - creates a file


Module-New documentation Contained in the Module-New distribution.

Index


Code Index:

NAME

Top

Module::New::Recipe::File - creates a file

USAGE

Top

From the shell/command line:

module_new file Module::Name

creates lib/Module/Name.pm (with ::File::Module template).

module_new file t/test.t

creates t/test.t (with ::File::Test template).

module_new file bin/script

creates bin/script (with ::File::Script template).

OPTIONS

Top

type
  module_new file --type=MainModule Main::Module

You can explicitly specify a file type (actually a template module under the ::File namespace) with this option.

in
  module_new file Test::Module --in t

creates t/lib/Test/Module.pm, not <lib/Test/Module.pm>.

edit
  module_new file Test::Module --edit

If set to true, you can edit the file you created.

AUTHOR

Top

Kenichi Ishigaki, <ishigaki at cpan.org>

COPYRIGHT AND LICENSE

Top


Module-New documentation Contained in the Module-New distribution.

package Module::New::Recipe::File;

use strict;
use warnings;
use Module::New::Recipe;
use Module::New::Command::Basic;

available_options qw( edit|e type|t=s );

flow {
  guess_root;

  loop {
    set_file;

    create_files('{ANY_TYPE}');

    edit_mainfile( optional => 1 );
  };

  create_manifest;
};

1;

__END__