| Version 18 (modified by bowtie, 6 months ago) (diff) |
|---|
Skeleton Generation
Module::Starter
As a first step in the direction of supporting CPAN-style Perl projects we integrated into Padre the use of Module::Starter, The intent is to make it as easy as possible for CPAN authors (and especially for first-time CPAN authors) to have installers that follow all the best practices for distribution installation, but involve as much DWIM (Do What I Mean) as possible when writing them.
The "bones" of every new module are basically the same: even if it's not your intention to distribute, you should still Build, new module frameworks automatically. PBP
- The original, oldest module for installing modules is ExtUtils::MakeMaker.
- the daddy, old, use one of the other's
- Module::Build is pure-perl. This means it does not require a make program to be installed for you to build/install modules. In fact, you don't even need a shell, so even platforms like MacOS (traditional) can use it fairly easily. This is not a problem with recent versions of perl because Module::Build is a core module.
- pure-perl :)
- Module::Install is a package for writing installers for CPAN (or CPAN-like) distributions that are clean, simple, minimalist, act in a strictly correct manner with ExtUtils::MakeMaker, Another very unique feature is auto-install. When the module author enables auto-install for his distribution, Module::Install will search for and install any pre-requisite modules that are not installed when Makefile.PL is executed.
- used by Catalyst
module-starter will look for a configuration file before reading its command line parameters. The default location is $HOME/.module-starter/config but if the MODULE_STARTER_DIR environment variable is set, module-starter will look for config in that directory.
File -> New -> Perl Distribution
Will bring up a dialog box where you can select some of the parameters your new project.
- Perl 5 Script: generates a *.pl file
- Perl 5 Module: generates a *.pm file
- Perl 5 Test: generates a *.t file
- Perl 6 Script: genertes a *.pl file
NB. from Padre/share/templates/
Perl Distribution
- Module Name: <your module name>
- note first letter should be Capitalised and :: (package identifiers) supported.
- You can now add multiple module names, ie: Foo::Bar, Foo::Bar::Two (csv)
- note first letter should be Capitalised and :: (package identifiers) supported.
- Author: <your name>
- note this will ignore author: in ~/.moule-starter/config
- Email Address: <your e-mail address>
- note this will ignore email: in ~/.moule-starter/config
- Builder: select an Option
- note you can change the default Option, Tools => Preferences => Advanced => builder
- License: select n Option
- note you can change the default Option, Tools => Preferences => Advanced => license
- Parent Directory: <the dir you wish to build your skeleton in>
Once you click OK, Module::Starter will create a new directory in the parent directory you selected.
Tree view of Skeleton (Vanilla) Build
Mail-Check/
├── Changes
├── ignore.txt
├── lib
│ └── Mail
│ └── Check.pm
├── Makefile.PL
├── MANIFEST
├── README
└── t
├── 00.load.t
├── perlcritic.t
├── pod-coverage.t
└── pod.t
To Do Next
- Load appropriate *.Pl and Run => Run Script
| Skeleton | Action |
|---|---|
| Module::Build | perl Build.PL |
| Module::Install | perl Makfile.PL |
| ExtUtils::MakeMaker | perl Makefile.PL |
Tickets
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #1324 | fixed | One of our features is missing... Skelton Build or Module::Starter | adamk | bowtie |
Test
Perl distributions and templates and running
- create a new Perl 5 distribution: "File" -> "New" -> "Perl Distribution ..."
- create an additional "hello, world" style Perl 5 module in the same namespace: "File" -> "New" -> "Perl 5 Module"
- use "File" -> "Save Intuition" to save the module
- create a test for the module: "File" -> "New" -> "Perl 5 Test"
- run the test: "Run" -> "Run Tests"
- run the test: "Run" -> "Run and Build Tests"
- create a new Perl 5 script that uses the module: "File" -> "New" -> "Perl 5 Script"
- run it: "Run" -> "Run Script"
- run it: "Run" -> "Run Script (Debug Info)"
- add an infinite loop the the script
- run the script and abort it using F6
Attachments
-
fnnd.png
(40.8 KB) -
added by bowtie 2 years ago.
image of File -> New -> Perl Distribution
-
builder.png
(10.6 KB) -
added by bowtie 2 years ago.
list of builder options
-
modstart.png
(26.7 KB) -
added by bowtie 2 years ago.
image of new Perl Distribution setup
-
license.png
(37.9 KB) -
added by bowtie 2 years ago.
list of license options
-
modstart2.png
(26.2 KB) -
added by bowtie 6 months ago.
image of new Perl Distribution setup





