Skip to content

Commit

Permalink
Removed unused methods
Browse files Browse the repository at this point in the history
The use of the no_latest method ws removed in aab539f

There is no reference to '->favorites'
  • Loading branch information
mickeyn committed Jun 18, 2017
1 parent bedb887 commit 4bcdb89
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions lib/MetaCPAN/Web/Model/API/Release.pm
Expand Up @@ -320,61 +320,12 @@ sub versions {
);
}

sub favorites {
my $self = shift;
$self->request( '/favorite/_search', {} );
}

sub topuploaders {
my ( $self, $range ) = @_;
my $param = $range ? { range => $range } : ();
$self->request( '/release/top_uploaders', undef, $param );
}

sub no_latest {
my ( $self, @distributions ) = @_;

# If there are no distributions return
return Future->done( {} ) unless (@distributions);

@distributions = uniq @distributions;
$self->request(
'/release/_search',
{
size => scalar @distributions,
query => {
bool => {
must => [
{ terms => { distribution => \@distributions } },
{ term => { status => 'latest' } }
]
}
},
fields => [qw(distribution status)]
}
)->transform(
done => sub {
my $data = shift;
my @latest
= map { $_->{fields}->{distribution} }
@{ $data->{hits}->{hits} };
return (
{
took => $data->{took},
no_latest => {
map {
my $distro = $_;
( first { $_ eq $distro } @latest )
? ()
: ( $distro, 1 );
} @distributions
}
}
);
}
);
}

__PACKAGE__->meta->make_immutable;

1;

0 comments on commit 4bcdb89

Please sign in to comment.