Skip Menu |

This queue is for tickets about the PPI-PowerToys CPAN distribution.

Report information
The Basics
Id: 45558
Status: resolved
Priority: 0/
Queue: PPI-PowerToys

People
Owner: Nobody in particular
Requestors: DAKKAR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.11
Fixed in: 0.12



Subject: recognize "our $VERSION"
The attached patch allows ppi_version to recognize the "our $VERSION" idiom.
Subject: ppi-powertoy-our-version.patch
diff --git a/lib/PPI/App/ppi_version.pm b/lib/PPI/App/ppi_version.pm index 2801843..3f89a7b 100644 --- a/lib/PPI/App/ppi_version.pm +++ b/lib/PPI/App/ppi_version.pm @@ -62,7 +62,11 @@ sub show { $_[1]->content =~ m/^\$(?:\w+::)*VERSION$/ or return ''; # It is the first thing in the statement - $_[1]->sprevious_sibling and return ''; + my $decl = $_[1]->sprevious_sibling; + if (!$decl or !( + $decl->isa('PPI::Token::Word') + && $decl->content eq 'our' + )) { return ''; } # Followed by an "equals" my $equals = $_[1]->snext_sibling or return '';
Support for 'our $VERSION' was added in 0.12 which was released on 2009-04-30. Also, this ticket is a duplicate of https://rt.cpan.org/Ticket/Display.html?id=30349