Skip to content

Commit

Permalink
use numified versions for exact version checks in download_url
Browse files Browse the repository at this point in the history
If we are given a version spec like '== 1.013030', it should match 1.013_03.
This matches the behavior of the other version specs.
  • Loading branch information
haarg committed May 17, 2017
1 parent 8891d68 commit 442012a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/MetaCPAN/Document/File/Set.pm
Expand Up @@ -318,7 +318,15 @@ sub _version_filters {
return () unless $version;

if ( $version =~ s/^==\s*// ) {
return +{ must => [ { term => { 'module.version' => $version } } ] };
return +{
must => [
{
term => {
'module.version_numified' => $self->_numify($version)
}
}
]
};
}
elsif ( $version =~ /^[<>!]=?\s*/ ) {
my %ops = qw(< lt <= lte > gt >= gte);
Expand Down

0 comments on commit 442012a

Please sign in to comment.