Skip to content

Commit 27f61bd

Browse files
authored
Merge branch 'Perl-Toolchain-Gang:master' into master
2 parents f94d102 + 8f3ca82 commit 27f61bd

File tree

9 files changed

+149
-84
lines changed

9 files changed

+149
-84
lines changed

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

CONTRIBUTING

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,16 @@ Once installed, here are some dzil commands you might try:
7272
You can learn more about Dist::Zilla at http://dzil.org/.
7373

7474
The code for this distribution is hosted at GitHub. The repository is:
75+
7576
https://github.com/Perl-Toolchain-Gang/Module-Metadata
77+
7678
You can submit code changes by forking the repository, pushing your code
7779
changes to your clone, and then submitting a pull request. Please include a
7880
suitable end-user-oriented entry in the Changes file describing your change.
7981
Detailed instructions for doing that is available here:
8082

8183
https://help.github.com/articles/creating-a-pull-request
8284

83-
All pull requests for this distribution will be automatically tested on Linux
84-
by Travis at: https://travis-ci.com/Perl-Toolchain-Gang/Module-Metadata
85-
Results will be visible in the pull request on GitHub. Follow the appropriate
86-
links for details when tests fail. Changes will not be mergeable until all
87-
tests pass.
88-
8985
If you have found a bug, but do not have an accompanying patch to fix it, you
9086
can submit an issue report here:
9187
https://rt.cpan.org/Public/Dist/Display.html?Name=Module-Metadata
@@ -103,5 +99,5 @@ wish to be listed under a different name or address, you should submit a pull
10399
request to the .mailmap file to contain the correct mapping.
104100

105101

106-
This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.014
107-
from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.150.
102+
This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.015
103+
from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.162.

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ Revision history for Module-Metadata
22

33
{{$NEXT}}
44

5+
1.000038 2023-04-28 11:25:40Z
6+
- detects "class" syntax
7+
58
1.000037 2019-09-07 18:32:44Z
69
- add decode_pod option for automatic =encoding handling
710

INSTALL

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ Alternatively, if your CPAN shell is set up, you should just be able to do:
2121

2222
## Manual installation
2323

24-
As a last resort, you can manually install it. Download the tarball, untar it,
25-
install configure prerequisites (see below), then build it:
24+
As a last resort, you can manually install it. If you have not already
25+
downloaded the release tarball, you can find the download link on the module's
26+
MetaCPAN page: https://metacpan.org/pod/Module::Metadata
27+
28+
Untar the tarball, install configure prerequisites (see below), then build it:
2629

2730
% perl Makefile.PL
2831
% make && make test

LICENCE

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,21 +292,21 @@ Definitions:
292292

293293
- "Package" refers to the collection of files distributed by the Copyright
294294
Holder, and derivatives of that collection of files created through
295-
textual modification.
295+
textual modification.
296296
- "Standard Version" refers to such a Package if it has not been modified,
297297
or has been modified in accordance with the wishes of the Copyright
298-
Holder.
298+
Holder.
299299
- "Copyright Holder" is whoever is named in the copyright or copyrights for
300-
the package.
300+
the package.
301301
- "You" is you, if you're thinking about copying or distributing this Package.
302302
- "Reasonable copying fee" is whatever you can justify on the basis of media
303303
cost, duplication charges, time of people involved, and so on. (You will
304304
not be required to justify it to the Copyright Holder, but only to the
305-
computing community at large as a market that must bear the fee.)
305+
computing community at large as a market that must bear the fee.)
306306
- "Freely Available" means that no fee is charged for the item itself, though
307307
there may be fees involved in handling the item. It also means that
308308
recipients of the item may redistribute it under the same conditions they
309-
received it.
309+
received it.
310310

311311
1. You may make and give away verbatim copies of the source form of the
312312
Standard Version of this Package without restriction, provided that you
@@ -373,7 +373,7 @@ products derived from this software without specific prior written permission.
373373

374374
9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
375375
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
376-
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
376+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
377377

378378
The End
379379

README.pod

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Module::Metadata - Gather package and POD information from perl module files
88

99
=head1 VERSION
1010

11-
version 1.000037
11+
version 1.000038
1212

1313
=head1 SYNOPSIS
1414

@@ -240,7 +240,7 @@ assistance from David Golden (xdg) <[email protected]>.
240240

241241
=head1 CONTRIBUTORS
242242

243-
=for stopwords Karen Etheridge David Golden Vincent Pit Matt S Trout Chris Nehren Tomas Doran Olivier Mengué Graham Knop tokuhirom Tatsuhiko Miyagawa Christian Walde Leon Timmermans Peter Rabbitson Steve Hay Jerry D. Hedden Craig A. Berry Mitchell Steinbrunner Edward Zborowski Gareth Harper James Raspass 'BinGOs' Williams Josh Jore Kent Fredric
243+
=for stopwords Karen Etheridge David Golden Vincent Pit Matt S Trout Chris Nehren Graham Knop Olivier Mengué Tomas Doran Christian Walde Craig A. Berry Tatsuhiko Miyagawa tokuhirom 'BinGOs' Williams Mitchell Steinbrunner Edward Zborowski Gareth Harper James Raspass Jerry D. Hedden Josh Jore Kent Fredric Leon Timmermans Peter Rabbitson Steve Hay
244244

245245
=over 4
246246

@@ -266,83 +266,79 @@ Chris Nehren <[email protected]>
266266

267267
=item *
268268

269-
Tomas Doran <[email protected]>
269+
Graham Knop <[email protected]>
270270

271271
=item *
272272

273273
Olivier Mengué <[email protected]>
274274

275275
=item *
276276

277-
Graham Knop <[email protected]>
278-
279-
=item *
280-
281-
tokuhirom <[email protected]>
277+
Tomas Doran <[email protected]>
282278

283279
=item *
284280

285-
Tatsuhiko Miyagawa <[email protected]>
281+
Christian Walde <[email protected]>
286282

287283
=item *
288284

289-
Christian Walde <[email protected]>
285+
Craig A. Berry <[email protected]>
290286

291287
=item *
292288

293-
Leon Timmermans <[email protected]>
289+
Tatsuhiko Miyagawa <[email protected]>
294290

295291
=item *
296292

297-
Peter Rabbitson <[email protected]>
293+
tokuhirom <[email protected]>
298294

299295
=item *
300296

301-
Steve Hay <[email protected]>
297+
Chris 'BinGOs' Williams <[email protected]>
302298

303299
=item *
304300

305-
Jerry D. Hedden <[email protected]>
301+
David Mitchell <[email protected]>
306302

307303
=item *
308304

309-
Craig A. Berry <[email protected]>
305+
David Steinbrunner <[email protected]>
310306

311307
=item *
312308

313-
Craig A. Berry <craigberry@mac.com>
309+
Edward Zborowski <ed@rubensteintech.com>
314310

315311
=item *
316312

317-
David Mitchell <davem@iabyn.com>
313+
Gareth Harper <gareth@broadbean.com>
318314

319315
=item *
320316

321-
David Steinbrunner <dsteinbrunner@pobox.com>
317+
James Raspass <jraspass@gmail.com>
322318

323319
=item *
324320

325-
Edward Zborowski <[email protected]>
321+
Jerry D. Hedden <[email protected]>
326322

327323
=item *
328324

329-
Gareth Harper <[email protected]>
325+
Josh Jore <[email protected]>
330326

331327
=item *
332328

333-
James Raspass <[email protected]>
329+
Kent Fredric <[email protected]>
334330

335331
=item *
336332

337-
Chris 'BinGOs' Williams <[email protected]>
333+
Leon Timmermans <[email protected]>
338334

339335
=item *
340336

341-
Josh Jore <jjore@cpan.org>
337+
Peter Rabbitson <ribasushi@cpan.org>
342338

343339
=item *
344340

345-
Kent Fredric <[email protected]>
341+
Steve Hay <[email protected]>
346342

347343
=back
348344

lib/Module/Metadata.pm

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ sub __clean_eval { eval $_[0] }
1414
use strict;
1515
use warnings;
1616

17-
our $VERSION = '1.000038';
17+
our $VERSION = '1.000039';
1818

1919
use Carp qw/croak/;
2020
use File::Spec;
@@ -74,11 +74,22 @@ my $PKG_REGEXP = qr{ # match a package declaration
7474
\s+ # whitespace
7575
($PKG_NAME_REGEXP) # a package name
7676
\s* # optional whitespace
77-
($V_NUM_REGEXP)? # optional version number
78-
\s* # optional whitesapce
77+
($V_NUM_REGEXP)? # optional version number
78+
\s* # optional whitespace
7979
[;\{] # semicolon line terminator or block start (since 5.16)
8080
}x;
8181

82+
my $CLASS_REGEXP = qr{ # match a class declaration (core since 5.38)
83+
^[\s\{;]* # intro chars on a line
84+
class # the word 'class'
85+
\s+ # whitespace
86+
($PKG_NAME_REGEXP) # a package name
87+
\s* # optional whitespace
88+
($V_NUM_REGEXP)? # optional version number
89+
\s* # optional whitespace
90+
[;\{] # semicolon line terminator or block start
91+
}x;
92+
8293
my $VARNAME_REGEXP = qr{ # match fully-qualified VERSION name
8394
([\$*]) # sigil - $ or *
8495
(
@@ -627,7 +638,7 @@ sub _parse_fh {
627638
? $self->_parse_version_expression( $line )
628639
: ();
629640

630-
if ( $line =~ /$PKG_REGEXP/o ) {
641+
if ( $line =~ /$PKG_REGEXP/o or $line =~ /$CLASS_REGEXP/ ) {
631642
$package = $1;
632643
my $version = $2;
633644
push( @packages, $package ) unless grep( $package eq $_, @packages );

t/extract-package.t

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,29 @@ $VERSION = '999';
127127
$::VERSION = 0.01;
128128
---
129129
},
130+
{
131+
name => 'class NAME::SUBNAME',
132+
package => [ 'Simple::Edward' ],
133+
code => <<'---',
134+
class Simple::Edward;
135+
---
136+
},
137+
{
138+
name => 'class NAME::SUBNAME',
139+
package => [ 'main', 'Simple::Edward' ],
140+
code => <<'---',
141+
our $foo = 1;
142+
class Simple::Edward;
143+
---
144+
},
145+
{
146+
name => 'package and class declarations',
147+
package => [ 'Ticket::Widget::Entry' ],
148+
code => <<'---',
149+
package Ticket::Widget::Entry 0.36;
150+
class Ticket::Widget::Entry :strict(params) :isa(Tickit::Widget);
151+
---
152+
},
130153
);
131154

132155
my $test_num = 0;

0 commit comments

Comments
 (0)