Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
1. case-insensitive extension in the 2nd case (like 1st & 3rd)
2. read from correct key in %_pod_score
  • Loading branch information
mickeyn committed May 12, 2016
1 parent 6c384f1 commit fc3666b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/MetaCPAN/Document/Module.pm
Expand Up @@ -170,12 +170,12 @@ sub set_associated_pod {
$_->path =~ /^README\.pod$/i ? -10 :

# If the name of the package matches the name of the file,
$_->path =~ m!(^lib/)?\b${mod_path}.(pod|pm)$! ?
$_->path =~ m!(^lib/)?\b${mod_path}.((?i)pod|pm)$! ?
# Score pod over pm, and boost (most points for 'lib' dir).
($1 ? 50 : 25) + $_pod_score{$2} :
($1 ? 50 : 25) + $_pod_score{lc($2)} :

# Sort files by extension: Foo.pod > Foo.pm > foo.pl.
$_->name =~ /\.(pod|pm|pl)/i ? $_pod_score{$1} :
$_->name =~ /\.(pod|pm|pl)/i ? $_pod_score{lc($1)} :

# Otherwise score unknown (near the bottom).
-1
Expand Down

0 comments on commit fc3666b

Please sign in to comment.