Skip to content

Commit

Permalink
Move recent change log parsing to release controller
Browse files Browse the repository at this point in the history
We don't need to do it for the pod controller.
  • Loading branch information
rwstauner committed Mar 20, 2014
1 parent 6bf5456 commit e174e9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions lib/MetaCPAN/Web/Controller/Release.pm
Expand Up @@ -62,6 +62,7 @@ sub view : Private {
{
files => $model->interesting_files( $author, $release ),
modules => $model->modules( $author, $release ),
changes => $c->model('API::Changes')->get( $author, $release ),
},
$out,
);
Expand Down Expand Up @@ -105,6 +106,9 @@ sub view : Private {
push @view_files, $h;
}

my $changes
= $c->model('API::Changes')->last_version( $reqs->{changes}, $out );

# TODO: make took more automatic (to include all)
$c->stash(
{
Expand All @@ -118,6 +122,7 @@ sub view : Private {
root => \@root_files,
examples => \@examples,
files => \@view_files,
( $changes ? ( last_version_changes => $changes ) : () ),
}
);
}
Expand Down
6 changes: 0 additions & 6 deletions lib/MetaCPAN/Web/Role/ReleaseInfo.pm
Expand Up @@ -39,8 +39,6 @@ sub api_requests {
$c->model('API::Release')->versions( $data->{distribution} ),
distribution =>
$c->model('API::Release')->distribution( $data->{distribution} ),
changes =>
$c->model('API::Changes')->get( $data->{author}, $data->{name} ),
%$reqs,
};
}
Expand All @@ -49,9 +47,6 @@ sub api_requests {
sub stash_api_results {
my ( $self, $c, $reqs, $data ) = @_;

my $changes
= $c->model('API::Changes')->last_version( $reqs->{changes}, $data, );

$c->stash(
{
author => $reqs->{author},
Expand All @@ -62,7 +57,6 @@ sub stash_api_results {
versions => [
map { $_->{fields} } @{ $reqs->{versions}->{hits}->{hits} }
],
( $changes ? ( last_version_changes => $changes ) : () ),
}
);
}
Expand Down

0 comments on commit e174e9e

Please sign in to comment.