The Musings of a Dyslexic Technologist

A blogging framework for bowtie.

Announcing App::Midgen v0.28

So what’s new?

  • Now with support for prereqs->runtime->recommends Meta-CPAN-spec v2
  • Internal scanner update and why
    • New scanner UseModule, Module::Runtime support
    • Scanner Eval now supports try Blocks as well.
    • Internal scanners now provide version strings, used by infile, output format
  • Changes to the output formats:
    • Output format, eumm, added for ExtUtils::MakeMaker (enabling –> META.json)
    • Updates to metacpan && cpanfile to show prereqs->runtime->recommends

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.

Internal Scanner update

The internal scanners now all return version strings if present, which is being utilized by the infile output format initially.

Bug: only return Module::Name that start with first character upper OLIVER++, Fixed

UseModule new scanner

Following on from a suggestion from mst on #toolchain to support Module::Runtime includes, has turned in to a new scanner UseModule.

Checking for the following, extracting module name and version strings.

A selection of what UseModule supports
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use_module("Module::Name", x.xx)->new( ... );
require_module( 'Module::Name');
use_package_optimistically("Module::Name", x.xx)->new( ... );

my $abc = use_module("Module::Name", x.xx)->new( ... );
my $abc = use_package_optimistically("Module::Name", x.xx)->new( ... );

$abc = use_module("Module::Name", x.xx)->new( ... );
$abc = use_package_optimistically("Module::Name", x.xx)->new( ... );

return use_module( 'Module::Name', x,xx )->new( ... );
return use_package_optimisticall( 'Module::Name', x.xx )->new( ... );

my $HAVE_MOOSE = eval { require Moose; 1; };

We also support the prefix Module::Runtime::... in the above.

Eval now supports try

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

A selection of what Eval supports
1
2
3
4
5
6
7
8
9
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; };

try { no Moose; 1; };
try { require Moose };
my $HAVE_MOOSE = try { require Moose; 1; };

Bug: Catch for postfix if, Fixed

require MRO::Compat if $] < 5.009_005;

Output formats:

To show the use of UseModule and Eval in the examples below.

Please note that we are using prereqs->runtime->recommends to highlight these found modules for you.

perl-minversion is 5.010 in following examples due to mro see below and infile later.

1
2
3
4
5
6
7
8
9
10
11
12
13
Perl::MinimumVersion::Fast  {
    public methods (5) : minimum_explicit_version, minimum_syntax_version, minimum_version, new, version_markers
    private methods (2) : _build_minimum_explicit_version, _build_minimum_syntax_version
    internals: {
        minimum_explicit_version   undef,
        minimum_syntax_version     version,
        version_markers            {
            5.010   [
                [0] "use mro"
            ]
        }
    }
}

eumm

The eumm output format, added for ExtUtils::MakeMaker (enabling –> META.json) is a complete rework of the previous dzil.

midgen --format eumm

Output Format eumm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use strict;
use warnings;
use ExtUtils::MakeMaker 6.68;

WriteMakefile(
   'NAME' => 'Class::Accessor::Grouped',
   'VERSION_FROM' => 'lib/Class/Accessor/Grouped.pm',
   'ABSTRACT_FROM' => 'lib/Class/Accessor/Grouped.pm',
   'AUTHOR' => '...',
   'LICENSE' => 'perl',
   'BUILD_REQUIRES' => {
      'ExtUtils::MakeMaker' => '6.68'
   },
   'CONFIGURE_REQUIRES' => {
      'ExtUtils::MakeMaker' => '6.68'
   },
   'MIN_PERL_VERSION' => '5.010',
   'PREREQ_PM' => {
       'Class::XSAccessor' => '1.19',
       'MRO::Compat'       => '0.12',
       'Module::Runtime'   => '0.014',
       'Sub::Name'         => '0.05',
   },
   'TEST_REQUIRES' => {
       'Test::Exception'        => '0.32',
       'Test::More'             => '1.001002',
   },
   'META_MERGE' => {
      'meta-spec' => { 'version' => '2' },
      'prereqs' => {
         'test' => {
            'suggests' => {
                'Devel::Hide'         => '0.0009',
                'Package::Stash'      => '0.36',
                'Pod::Coverage'       => '0.23',
                'Test::CheckManifest' => '1.28',
                'Test::NoTabs'        => '1.3',
                'Test::Pod'           => '1.48',
                'Test::Pod::Coverage' => '1.08',
                'Test::Spelling'      => '0.19',
                'Test::Strict'        => '0.22',
            }
         }
      },
   },
)

metajson

Now with support for prereqs->runtime->recommends Meta-CPAN-spec v2

midgen --format metajson

Output Format metajson
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
   "prereqs" : {
      "runtime" : {
         "requires" : {
            "Module::Runtime" : "0.014",
            "perl" : "5.010",
         },
         "suggests" : {...},
         "recommends" : {
            "Class::XSAccessor" : "1.19",
            "MRO::Compat" : "0.12",
            "Sub::Name" : "0.05",
         }
      "test" : {
         "requires" : {
            "Test::Exception" : "0.32",
            "Test::More" : "1.001002",
         },
         "suggests" : {
            "Devel::Hide" : "0.0009",
            "Package::Stash" : "0.36",
            "Pod::Coverage" : "0.23",
            "Test::CheckManifest" : "1.28",
            "Test::NoTabs" : "1.3",
            "Test::Pod" : "1.48",
            "Test::Pod::Coverage" : "1.08",
            "Test::Spelling" : "0.19",
            "Test::Strict" : "0.22",
         }
      }
   }
   "no_index" : {
      "directory" : [
         "inc",
         "t",
      ]
   },
}

cpanfile

Now with support for prereqs->runtime->recommends Meta-CPAN-spec v2

midgen --format cpanfile

Output Format metajson
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
requires 'Module::Runtime', '0.014';
requires 'perl',            '5.010';

recommends 'Class::XSAccessor', '1.19';
recommends 'MRO::Compat',       '0.12';
recommends 'Sub::Name',         '0.05';

on test => sub {
  requires 'Test::Exception',        '0.32';
  requires 'Test::More',             '1.001002';

  suggests 'Devel::Hide',         '0.0009';
  suggests 'Package::Stash',      '0.36';
  suggests 'Pod::Coverage',       '0.23';
  suggests 'Test::CheckManifest', '1.28';
  suggests 'Test::NoTabs',        '1.3';
  suggests 'Test::Pod',           '1.48';
  suggests 'Test::Pod::Coverage', '1.08';
  suggests 'Test::Spelling',      '0.19';
  suggests 'Test::Strict',        '0.22';
};

infile

midgen --format infile

Change to internals means that we no longer exclude any found modules.

We no longer check against METAcpan.Api for --format infile, so it is much quicker.

pros you are going to get a lot more information.

cons you might see some duplicates as some modules are found by more than one additional scanner.

Output Format infile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
------------------------------------------------------------------------
 | Module                   | Version  | Found in                         |
  ------------------------------------------------------------------------
 | AccessorGroups           | 0        | /t/lib/AccessorGroupsSubclass.pm |
 | AccessorGroupsComp       | 0        | /t/component.t                   |
 | AccessorGroupsParent     | 0        | /t/lib/AccessorGroups.pm         |
 | AccessorGroupsRO         | 0        | /t/accessors_ro.t                |
 | AccessorGroupsSubclass   | 0        | /t/accessors.t                   |
 | AccessorGroupsSubclass   | 0        | /t/accessors_xs_cachedwarn.t     |
 | AccessorGroupsSubclass   | 0        | /t/illegal_name.t                |
 | AccessorGroupsWO         | 0        | /t/accessors_wo.t                |
 | B                        | 0        | /t/accessors.t                   |
 | B                        | 0        | /lib/Class/Accessor/Grouped.pm   |
 | B                        | 0        | /t/basic.t                       |
 | B                        | 0        | /lib/Class/Accessor/Grouped.pm   |
 | BaseInheritedGroups      | 0        | /t/lib/SuperInheritedGroups.pm   |
 | Carp                     | 0        | /lib/Class/Accessor/Grouped.pm   |
 | Class::Accessor::Grouped | 0        | /t/lib/AccessorGroupsParent.pm   |
 | Class::Accessor::Grouped | 0        | /t/lib/AccessorGroupsRO.pm       |
 | Class::Accessor::Grouped | 0        | /t/lib/AccessorGroupsWO.pm       |
 | Class::Accessor::Grouped | 0        | /t/accessors_xs_cachedwarn.t     |
 | Class::Accessor::Grouped | 0        | /t/accessors_xs_cachedwarn.t     |
 | Class::Accessor::Grouped | 0        | /t/lib/AccessorGroupsComp.pm     |
 | Class::Accessor::Grouped | 0        | /t/lib/ExtraInheritedGroups.pm   |
 | Class::Accessor::Grouped | 0        | /t/lib/BaseInheritedGroups.pm    |
 | Class::Accessor::Grouped | 0        | /t/accessors_pp.t                |
 | Class::Accessor::Grouped | 0        | /t/accessors_pp.t                |
 | Class::Accessor::Grouped | 0        | /t/clean_namespace.t             |
 | Class::Accessor::Grouped | 0        | /t/accessors_xs.t                |
 | Class::Accessor::Grouped | 0        | /t/accessors_xs.t                |
 | Class::Accessor::Grouped | 0        | /t/lib/NotHashBased.pm           |
 | Class::XSAccessor        | 0        | /t/accessors_xs_cachedwarn.t     |
 | Class::XSAccessor        | 0        | /t/accessors_xs_cachedwarn.t     |
 | Class::XSAccessor        | 0        | /lib/Class/Accessor/Grouped.pm   |
 | Class::XSAccessor        | 0        | /t/accessors_xs.t                |
 | Class::XSAccessor        | 0        | /t/accessors_xs.t                |
 | Config                   | 0        | /t/accessors_ro.t                |
 | Config                   | 0        | /t/accessors_wo.t                |
 | Data::Dumper             | 0        | /lib/Class/Accessor/Grouped.pm   |
 | Data::Dumper             | 0        | /t/accessors_xs_cachedwarn.t     |
 | Devel::Hide              | 0        | /t/accessors_pp.t                |
 | Devel::Hide              | 0        | /t/accessors_pp.t                |
 | ExtraInheritedGroups     | 0        | /t/inherited.t                   |
 | File::Basename           | 0        | /t/strict.t                      |
 | File::Basename           | 0        | /t/strict.t                      |
 | File::Basename           | 0        | /t/warnings.t                    |
 | File::Basename           | 0        | /t/warnings.t                    |
 | File::Find               | 0        | /t/strict.t                      |
 | File::Find               | 0        | /t/warnings.t                    |
 | File::Find               | 0        | /t/warnings.t                    |
 | File::Find               | 0        | /t/strict.t                      |
 | File::Spec::Functions    | 0        | /t/accessors_xs.t                |
 | File::Spec::Functions    | 0        | /t/accessors_pp.t                |
 | File::Spec::Unix         | 0        | /t/accessors_pp.t                |
 | File::Spec::Unix         | 0        | /t/accessors_xs.t                |
 | FindBin                  | 0        | /t/accessors_pp.t                |
 | FindBin                  | 0        | /t/accessors_xs.t                |
 | MRO::Compat              | 0        | /lib/Class/Accessor/Grouped.pm   |
 | MRO::Compat              | 0        | /t/clean_namespace.t             |
 | MRO::Compat              | 0        | /t/clean_namespace.t             |
 | Module::Runtime          | 0        | /lib/Class/Accessor/Grouped.pm   |
 | NotHashBased             | 0        | /t/inherited.t                   |
 | Package::Stash           | 0        | /t/clean_namespace.t             |
 | Package::Stash           | 0        | /t/clean_namespace.t             |
 | Pod::Coverage            | 0.14     | /t/pod_coverage.t                |
 | Scalar::Util             | 0        | /lib/Class/Accessor/Grouped.pm   |
 | Sub::Name                | 0        | /t/illegal_name.t                |
 | Sub::Name                | 0        | /t/accessors_xs_cachedwarn.t     |
 | Sub::Name                | 0        | /t/accessors_xs_cachedwarn.t     |
 | Sub::Name                | 0        | /lib/Class/Accessor/Grouped.pm   |
 | Sub::Name                | 0        | /t/accessors_xs.t                |
 | Sub::Name                | 0        | /t/accessors_xs.t                |
 | Sub::Name                | 0        | /t/accessors_pp.t                |
 | Sub::Name                | 0        | /t/illegal_name.t                |
 | Sub::Name                | 0        | /t/accessors_pp.t                |
 | SuperInheritedGroups     | 0        | /t/inherited.t                   |
 | Test::CheckManifest      | 0.09     | /t/manifest.t                    |
 | Test::Exception          | 0        | /t/inherited.t                   |
 | Test::Exception          | 0        | /t/component.t                   |
 | Test::Exception          | 0        | /t/accessors_ro.t                |
 | Test::Exception          | 0        | /t/accessors_wo.t                |
 | Test::Exception          | 0        | /t/illegal_name.t                |
 | Test::More               | 0        | /t/strict.t                      |
 | Test::More               | 0        | /t/accessors_wo.t                |
 | Test::More               | 0        | /t/component.t                   |
 | Test::More               | 0        | /t/manifest.t                    |
 | Test::More               | 0        | /t/manifest.t                    |
 | Test::More               | 0        | /t/accessors.t                   |
 | Test::More               | 0        | /t/accessors_xs_cachedwarn.t     |
 | Test::More               | 0        | /t/pod_syntax.t                  |
 | Test::More               | 0        | /t/pod_syntax.t                  |
 | Test::More               | 0        | /t/pod_spelling.t                |
 | Test::More               | 0        | /t/pod_spelling.t                |
 | Test::More               | 0        | /t/basic.t                       |
 | Test::More               | 0        | /t/style_no_tabs.t               |
 | Test::More               | 0        | /t/style_no_tabs.t               |
 | Test::More               | 0        | /t/warnings.t                    |
 | Test::More               | 0        | /t/warnings.t                    |
 | Test::More               | 0        | /t/accessors_pp.t                |
 | Test::More               | 0        | /t/clean_namespace.t             |
 | Test::More               | 0        | /t/accessors_xs.t                |
 | Test::More               | 0        | /t/inherited.t                   |
 | Test::More               | 0        | /t/strict.t                      |
 | Test::More               | 0        | /t/illegal_name.t                |
 | Test::More               | 0        | /t/accessors_ro.t                |
 | Test::More               | 0        | /t/pod_coverage.t                |
 | Test::More               | 0        | /t/pod_coverage.t                |
 | Test::NoTabs             | 0.03     | /t/style_no_tabs.t               |
 | Test::Pod                | 1.00     | /t/pod_syntax.t                  |
 | Test::Pod::Coverage      | 1.04     | /t/pod_coverage.t                |
 | Test::Spelling           | 0.11     | /t/pod_spelling.t                |
 | Test::Strict             | 0        | /t/strict.t                      |
 | Test::Strict             | 0.05     | /t/warnings.t                    |
 | base                     | 0        | /t/lib/ExtraInheritedGroups.pm   |
 | base                     | 0        | /t/lib/NotHashBased.pm           |
 | base                     | 0        | /t/lib/SuperInheritedGroups.pm   |
 | base                     | 0        | /t/lib/BaseInheritedGroups.pm    |
 | base                     | 0        | /t/lib/AccessorGroups.pm         |
 | base                     | 0        | /t/lib/AccessorGroupsParent.pm   |
 | base                     | 0        | /t/lib/AccessorGroupsSubclass.pm |
 | base                     | 0        | /t/lib/AccessorGroupsComp.pm     |
 | base                     | 0        | /t/lib/AccessorGroupsRO.pm       |
 | base                     | 0        | /t/lib/AccessorGroupsWO.pm       |
 | base                     | 0        | /t/clean_namespace.t             |
 | constant                 | 0        | /lib/Class/Accessor/Grouped.pm   |
 | lib                      | 0        | /t/manifest.t                    |
 | lib                      | 0        | /t/pod_syntax.t                  |
 | lib                      | 0        | /t/accessors_xs_cachedwarn.t     |
 | lib                      | 0        | /t/component.t                   |
 | lib                      | 0        | /t/warnings.t                    |
 | lib                      | 0        | /t/accessors.t                   |
 | lib                      | 0        | /t/accessors_wo.t                |
 | lib                      | 0        | /t/accessors_xs.t                |
 | lib                      | 0        | /t/pod_spelling.t                |
 | lib                      | 0        | /t/inherited.t                   |
 | lib                      | 0        | /t/accessors_ro.t                |
 | lib                      | 0        | /t/illegal_name.t                |
 | lib                      | 0        | /t/pod_coverage.t                |
 | lib                      | 0        | /t/strict.t                      |
 | lib                      | 0        | /t/accessors_pp.t                |
 | mro                      | 0        | /lib/Class/Accessor/Grouped.pm   |
 | strict                   | 0        | /t/pod_spelling.t                |
 | strict                   | 0        | /t/lib/ExtraInheritedGroups.pm   |
 | strict                   | 0        | /t/manifest.t                    |
 | strict                   | 0        | /t/accessors.t                   |
 | strict                   | 0        | /t/accessors_xs_cachedwarn.t     |
 | strict                   | 0        | /lib/Class/Accessor/Grouped.pm   |
 | strict                   | 0        | /t/lib/AccessorGroupsComp.pm     |
 | strict                   | 0        | /t/accessors_pp.t                |
 | strict                   | 0        | /t/lib/SuperInheritedGroups.pm   |
 | strict                   | 0        | /t/basic.t                       |
 | strict                   | 0        | /t/pod_syntax.t                  |
 | strict                   | 0        | /t/clean_namespace.t             |
 | strict                   | 0        | /t/style_no_tabs.t               |
 | strict                   | 0        | /t/lib/AccessorGroupsWO.pm       |
 | strict                   | 0        | /t/warnings.t                    |
 | strict                   | 0        | /t/lib/AccessorGroupsRO.pm       |
 | strict                   | 0        | /t/component.t                   |
 | strict                   | 0        | /t/lib/NotHashBased.pm           |
 | strict                   | 0        | /t/inherited.t                   |
 | strict                   | 0        | /t/lib/BaseInheritedGroups.pm    |
 | strict                   | 0        | /t/lib/AccessorGroupsParent.pm   |
 | strict                   | 0        | /t/lib/AccessorGroups.pm         |
 | strict                   | 0        | /t/lib/AccessorGroupsSubclass.pm |
 | strict                   | 0        | /t/strict.t                      |
 | strict                   | 0        | /t/accessors_xs.t                |
 | strict                   | 0        | /t/accessors_wo.t                |
 | strict                   | 0        | /t/accessors_ro.t                |
 | strict                   | 0        | /t/illegal_name.t                |
 | strict                   | 0        | /t/pod_coverage.t                |
 | warnings                 | 0        | /t/warnings.t                    |
 | warnings                 | 0        | /t/illegal_name.t                |
 | warnings                 | 0        | /t/accessors.t                   |
 | warnings                 | 0        | /t/manifest.t                    |
 | warnings                 | 0        | /t/pod_syntax.t                  |
 | warnings                 | 0        | /t/accessors_xs_cachedwarn.t     |
 | warnings                 | 0        | /t/lib/NotHashBased.pm           |
 | warnings                 | 0        | /t/lib/SuperInheritedGroups.pm   |
 | warnings                 | 0        | /t/basic.t                       |
 | warnings                 | 0        | /t/lib/BaseInheritedGroups.pm    |
 | warnings                 | 0        | /t/style_no_tabs.t               |
 | warnings                 | 0        | /t/lib/AccessorGroupsRO.pm       |
 | warnings                 | 0        | /lib/Class/Accessor/Grouped.pm   |
 | warnings                 | 0        | /t/clean_namespace.t             |
 | warnings                 | 0        | /t/lib/AccessorGroupsComp.pm     |
 | warnings                 | 0        | /t/component.t                   |
 | warnings                 | 0        | /t/lib/AccessorGroupsWO.pm       |
 | warnings                 | 0        | /t/lib/AccessorGroups.pm         |
 | warnings                 | 0        | /t/lib/AccessorGroupsParent.pm   |
 | warnings                 | 0        | /t/lib/AccessorGroupsSubclass.pm |
 | warnings                 | 0        | /t/pod_spelling.t                |
 | warnings                 | 0        | /t/accessors_ro.t                |
 | warnings                 | 0        | /t/strict.t                      |
 | warnings                 | 0        | /t/accessors_pp.t                |
 | warnings                 | 0        | /t/lib/ExtraInheritedGroups.pm   |
 | warnings                 | 0        | /t/inherited.t                   |
 | warnings                 | 0        | /t/accessors_xs.t                |
 | warnings                 | 0        | /t/accessors_wo.t                |
 | warnings                 | 0        | /t/pod_coverage.t                |
  ------------------------------------------------------------------------

NB: This is the only output format which displays the found version string at present.

__END__