Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
few more fixes for problems exposed by tests
  • Loading branch information
mickeyn committed Apr 21, 2016
1 parent 1a7e606 commit 6077bf3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Document/Author.pm
Expand Up @@ -23,7 +23,7 @@ has name => (

has asciiname => (
is => 'ro',
required => 1,
required => 0,
index => 'analyzed',
isa => NonEmptySimpleStr,
);
Expand Down
1 change: 1 addition & 0 deletions lib/MetaCPAN/Document/Distribution.pm
Expand Up @@ -19,6 +19,7 @@ has bugs => (
is => 'ro',
isa => BugSummary,
dynamic => 1,
writer => '_set_bugs',
);

sub releases {
Expand Down
13 changes: 13 additions & 0 deletions lib/MetaCPAN/Document/Module.pm
Expand Up @@ -91,6 +91,19 @@ has associated_pod => (
writer => '_set_associated_pod',
);

has version_numified => (
is => 'ro',
isa => 'Num',
lazy_build => 1,
required => 1,
);

sub _build_version_numified {
my $self = shift;
return 0 unless ( $self->version );
return MetaCPAN::Util::numify_version( $self->version );
}

my $bom
= qr/(?:\x00\x00\xfe\xff|\xff\xfe\x00\x00|\xfe\xff|\xff\xfe|\xef\xbb\xbf)/;

Expand Down
1 change: 1 addition & 0 deletions lib/MetaCPAN/Document/Release.pm
Expand Up @@ -206,6 +206,7 @@ has authorized => (
required => 1,
isa => Bool,
default => 1,
writer => '_set_authorized',
);

has first => (
Expand Down
6 changes: 3 additions & 3 deletions t/lib/MetaCPAN/Tests/Release.pm
Expand Up @@ -107,7 +107,7 @@ has module_files => (
sub _build_module_files {
my ($self) = @_;
return $self->filter_files(
[ { exists => { field => 'file.module.name' } }, ] );
[ { exists => { field => 'module.name' } }, ] );
}

sub filter_files {
Expand All @@ -121,8 +121,8 @@ sub filter_files {
$self->index->type('file')->filter(
{
and => [
{ term => { 'file.author' => $release->author } },
{ term => { 'file.release' => $release->name } },
{ term => { 'author' => $release->author } },
{ term => { 'release' => $release->name } },
@{ $add_filters || [] },
],
}
Expand Down

0 comments on commit 6077bf3

Please sign in to comment.