The Musings of a Dyslexic Technologist

A blogging framework for bowtie.

Announcing App::Midgen v0.26

So what’s new?

  • Added Two more output formats:
    • infile, output format, module v perl files they were Found in
    • metajson, output format META.json
  • Internal scanner update and why
  • Finish off conversion to Type::Tiny

Food for thought, if we update our Modules, don’t we want our users to use the current version, so should we not by default do the same with others Modules. Thus we always show the current version number, regardless.

Two new output formats:

infile

The following was conceived to provided a solution to RT76527.

midgen --format infile

Output Format infile run against a test dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  -------------------------------------------------------
 | Module                | Version  | Found in           |
  -------------------------------------------------------
 | Bar                   | 0.2      | /lib/Anamal.pm     |
 | Carp::Always::Color   | 0        | /lib/Anamal.pm     |
 | Compiler::Lexer       | 0        | /lib/Anamal.pm     |
 | Data::Printer         | 0        | /lib/Anamal.pm     |
 | Foo                   | 0.123456 | /lib/Anamal.pm     |
 | Moo                   | 1.000    | /lib/Anamal.pm     |
 | Moo                   | 0.999    | /lib/Plugin/Dog.pm |
 | Moo                   | 0.888    | /lib/Plugin/Cat.pm |
 | Params::Util          | 0        | /lib/Anamal.pm     |
 | String::RewritePrefix | 0.005    | /lib/Anamal.pm     |
 | Test::Mock::LWP       | 0        | /t/666-tmw.t       |
 | Test::Mock::LWP       | 0        | /t/00.load.t       |
 | Test::More            | 0        | /t/pod.t           |
 | Test::More            | 0        | /t/pod-coverage.t  |
 | Test::More            | 0        | /t/666-tmw.t       |
 | Test::More            | 0        | /t/00.load.t       |
 | Test::Pod             | 0        | /t/pod.t           |
 | Test::Pod::Coverage   | 0        | /t/pod-coverage.t  |
 | Types::Standard       | 0        | /lib/Anamal.pm     |
 | X                     | 0        | /lib/Anamal.pm     |
  -------------------------------------------------------

NB: this is the only output format which displays the found version string, because it just makes sense in this instance. Many thanks to ETHER along the way.

metajson

The following is what midgen thinks your META.json might contain based upon your dist, or in this case a test dist.

midgen --format metajson

Internal Scanner update

These scanners enable midgen to identify prereqs->test->suggests from a META.json perspective.

Here is a flow chart that should help with why.

Many thanks to TOBYINK for his critique which resulted in the following taking another step forward.

Eval new scanner

Eval is not realy a new scanner, it’s just come of age with block support.

A selection of what Eval supports
1
2
3
4
5
eval "use Test::Kwalitee::Extra 0.000007";
eval "use Moo 1.002; 1;";
eval { no Moose; 1; };
eval { require Moose };
my $HAVE_MOOSE = eval { require Moose; 1; };

Test::Requires update

Support for barewords in Test::Requires scanner

Now supports barewords in Test::Requires
1
2
use Test::Requires { Moo };
use Test::Requires { Moose => '2.000' };

Finish off conversion to Type::Tiny

Why? one, so I can have a consistent Type system regardless of Moose or Moo, two, it’s faster. The Second part of the conversion from MooX::Types::MooseLike to Type::Tiny.

So we have gone from this:

1
2
use Moo::Role;
use MooX::Types::MooseLike::Base qw( InstanceOf );

To this:

1
2
use Types::Standard qw( InstanceOf );
use Moo::Role;

Many thanks to TOBYINK along the way.

__END__