Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Web/API/RequestInfo/Orchestrator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ sub _via_release {
my $model = $self->model;

Future->wait_all(
$model->get( $author, $release )->then( \&_fail_without_release )
$model->get( $author, $release )
->then( \&_fail_without_release )
->then( sub {
my $data = shift;
my $release_data = $data->{release};
Expand Down
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Web/Controller/Author.pm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ sub releases : Chained('root') PathPart Args(0) {
my $page = $req->page;
my $author_cv = $c->model('API::Author')->get($id);
my $releases
= $c->model('API::Release')->all_by_author( $id, $page, $page_size )
= $c->model('API::Release')
->all_by_author( $id, $page, $page_size )
->get;

my $author_info = $author_cv->get;
Expand Down
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Web/Controller/ContributingDoc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ sub get : Private {

my $contributing_re = qr/CONTRIBUTING|HACKING/i;
my $files
= $c->model('API::Release')->interesting_files( $author, $release )
= $c->model('API::Release')
->interesting_files( $author, $release )
->get->{files};

my $file = List::Util::first { $_->{name} =~ /$contributing_re/ } @$files;
Expand Down
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Web/Controller/Feed.pm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ sub recent : Private {
my $changes
= $c->model('API::Changes')
->by_releases(
[ map "$_->{author}/$_->{name}", @{ $c->stash->{recent} } ] )->get;
[ map "$_->{author}/$_->{name}", @{ $c->stash->{recent} } ] )
->get;

for ( @{ $c->stash->{recent} } ) {

Expand Down
4 changes: 3 additions & 1 deletion lib/MetaCPAN/Web/Controller/Lab.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@

my $report;
if ($pauseid) {
$report = $c->model('API::Lab')->fetch_latest_distros( 300, $pauseid )
$report

Check warning on line 64 in lib/MetaCPAN/Web/Controller/Lab.pm

View check run for this annotation

Codecov / codecov/patch

lib/MetaCPAN/Web/Controller/Lab.pm#L64

Added line #L64 was not covered by tests
= $c->model('API::Lab')
->fetch_latest_distros( 300, $pauseid )
->get;
}

Expand Down
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Web/Controller/Recent.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ sub index : Path : Args(0) {

my $filter = $req->params->{f} || 'l';
my ($data)
= $c->model('API::Release')->recent( $page, $page_size, $filter )
= $c->model('API::Release')
->recent( $page, $page_size, $filter )
->get;

$c->add_surrogate_key( 'RECENT', 'DIST_UPDATES' );
Expand Down
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Web/Controller/Recent/TopUploaders.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
my $data = $c->model('API::Release')->topuploaders($range)->get;

my $authors
= $c->model('API::Author')->get_multiple( keys %{ $data->{counts} } )
= $c->model('API::Author')
->get_multiple( keys %{ $data->{counts} } )

Check warning on line 32 in lib/MetaCPAN/Web/Controller/Recent/TopUploaders.pm

View check run for this annotation

Codecov / codecov/patch

lib/MetaCPAN/Web/Controller/Recent/TopUploaders.pm#L32

Added line #L32 was not covered by tests
->get;

$c->stash( {
Expand Down
6 changes: 4 additions & 2 deletions lib/MetaCPAN/Web/Controller/Requires.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ sub distribution : Chained('/dist/root') PathPart('requires') Args(0)

my $data
= $c->model('API::Release')
->reverse_dependencies( $dist, $page, $page_size, $sort )->get;
->reverse_dependencies( $dist, $page, $page_size, $sort )
->get;

my $pageset = Data::Pageset->new( {
current_page => $page,
Expand Down Expand Up @@ -59,7 +60,8 @@ sub module : Chained('/module/root') PathPart('requires') Args(0)

my $data
= $c->model('API::Module')
->requires( $module, $page, $page_size, $sort )->get;
->requires( $module, $page, $page_size, $sort )
->get;

my $pageset = Data::Pageset->new( {
current_page => $page,
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Web/Model/API/Author.pm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ sub get_multiple {
$data->{authors} = [ @authors{@authors} ];
$data;
}
)->then( \&_filter_authors );
)->then( \&_filter_authors );
}

sub search {
Expand Down
6 changes: 4 additions & 2 deletions lib/MetaCPAN/Web/Model/API/Permission.pm
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ sub _add_email_to_notification {

sub get_notification_info {
my ( $self, $module ) = @_;
$self->by_module($module)->then( $self->_permissions_to_notification )
->then( $self->_add_email_to_notification )->then( sub {
$self->by_module($module)
->then( $self->_permissions_to_notification )
->then( $self->_add_email_to_notification )
->then( sub {
my $data = shift;
Future->done( {
took => $data->{took},
Expand Down
15 changes: 10 additions & 5 deletions lib/MetaCPAN/Web/Model/API/Release.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,24 @@ sub coverage {

sub get {
my ( $self, $author, $release ) = @_;
$self->request("/release/$author/$release")->then( \&_with_distnameinfo )
$self->request("/release/$author/$release")
->then( \&_with_distnameinfo )
->then( \&_fix_dependency );
}

sub latest_by_author {
my ( $self, $pauseid ) = @_;
$self->request("/release/latest_by_author/$pauseid")
->then( \&_with_distnameinfo )->then( $self->add_river );
->then( \&_with_distnameinfo )
->then( $self->add_river );
}

sub all_by_author {
my ( $self, $pauseid, $page, $page_size ) = @_;
$self->request( "/release/all_by_author/$pauseid",
undef, { page => $page, page_size => $page_size } )
->then( \&_with_distnameinfo )->then( $self->add_river );
->then( \&_with_distnameinfo )
->then( $self->add_river );
}

sub recent {
Expand Down Expand Up @@ -86,7 +89,8 @@ sub modules {
sub find {
my ( $self, $distribution ) = @_;
$self->request("/release/latest_by_distribution/$distribution")
->then( \&_with_distnameinfo )->then( \&_fix_dependency );
->then( \&_with_distnameinfo )
->then( \&_fix_dependency );
}

# stolen from Module/requires
Expand Down Expand Up @@ -123,7 +127,8 @@ sub interesting_files {

sub versions {
my ( $self, $dist ) = @_;
$self->request("/release/versions/$dist")->then( \&_with_distnameinfo )
$self->request("/release/versions/$dist")
->then( \&_with_distnameinfo )
->then( sub {
my ($data) = @_;
$data->{versions} = delete $data->{releases};
Expand Down
7 changes: 4 additions & 3 deletions t/model/release.t
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ sub is_bool {
subtest modules => sub {
my @files
= @{ MetaCPAN::Web->model('API::Release')
->modules( 'OALDERS', 'HTTP-CookieMonster-0.09' )->get->{modules}
};
->modules( 'OALDERS', 'HTTP-CookieMonster-0.09' )
->get->{modules} };

ok( scalar @files, 'found files with modules' );

Expand Down Expand Up @@ -52,7 +52,8 @@ subtest versions => sub {
# Something with not too many versions.
my @versions
= @{ MetaCPAN::Web->model('API::Release')
->versions('Mojolicious-Plugin-HamlRenderer')->get->{versions} };
->versions('Mojolicious-Plugin-HamlRenderer')
->get->{versions} };

ok( scalar @versions, 'found release versions' );

Expand Down
Loading