Skip to content

Commit 115d573

Browse files
committed
Tidy?
1 parent ebb9db0 commit 115d573

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

lib/MetaCPAN/Web/Controller/Feed.pm

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ sub recent : Private {
3535
$c->forward('/recent/index');
3636
die join "\n", @{ $c->error } if @{ $c->error };
3737

38-
my $changes =
39-
$c->model('API::Changes')
40-
->by_releases(
38+
my $changes
39+
= $c->model('API::Changes')
40+
->by_releases(
4141
[ map "$_->{author}/$_->{name}", @{ $c->stash->{recent} } ] )
42-
->get;
42+
->get;
4343

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

@@ -96,7 +96,7 @@ sub author : Private {
9696
title => "Recent CPAN activity of $author - MetaCPAN",
9797
entries => [
9898
sort { $b->{date} cmp $a->{date} }
99-
@{ $self->_format_release_entries( $releases->{releases} ) },
99+
@{ $self->_format_release_entries( $releases->{releases} ) },
100100
@{ $self->_format_favorite_entries( $author, $faves ) }
101101
],
102102
);
@@ -147,7 +147,7 @@ my $feed_check = validation_for(
147147
},
148148
format => {
149149
type => Enum( [qw(atom rdf rss)] )
150-
->plus_coercions( Undef, '"rdf"', Str, 'lc $_' ),
150+
->plus_coercions( Undef, '"rdf"', Str, 'lc $_' ),
151151
default => 'rdf'
152152
},
153153
},
@@ -160,7 +160,7 @@ sub build_entry {
160160

161161
my $link = $args{host}->clone;
162162
$link->path( $entry->{link}
163-
|| join( '/', 'release', $entry->{author}, $entry->{name} ) );
163+
|| join( '/', 'release', $entry->{author}, $entry->{name} ) );
164164
$link->fragment( $entry->{fragment} ) if $entry->{fragment}; # for news
165165
$e->link( $link->as_string );
166166

@@ -193,28 +193,26 @@ sub build_feed {
193193
my $self = shift;
194194
my %params = $feed_check->(@_);
195195

196-
my $feed_class =
197-
$params{format} eq 'rdf' ? XML::FeedPP::RDF::
198-
: $params{format} eq 'rss' ? XML::FeedPP::RSS::
199-
: $params{format} eq 'atom' ? XML::FeedPP::Atom::Atom10::
200-
: die 'invalid format';
196+
my $feed_class
197+
= $params{format} eq 'rdf' ? XML::FeedPP::RDF::
198+
: $params{format} eq 'rss' ? XML::FeedPP::RSS::
199+
: $params{format} eq 'atom' ? XML::FeedPP::Atom::Atom10::
200+
: die 'invalid format';
201201

202202
my $feed = $feed_class->new;
203203
$feed->title( $params{title} );
204204
$feed->link("$params{link}");
205205
$feed->pubDate( $params{date}->iso8601 )
206-
if $params{date};
206+
if $params{date};
207207
$feed->description( $params{description} )
208-
if $params{description};
208+
if $params{description};
209209

210210
foreach my $entry ( @{ $params{entries} } ) {
211-
$feed->add_item(
212-
$self->build_entry(
213-
class => $feed->item_class,
214-
entry => $entry,
215-
host => $params{host},
216-
)
217-
);
211+
$feed->add_item( $self->build_entry(
212+
class => $feed->item_class,
213+
entry => $entry,
214+
host => $params{host},
215+
) );
218216
}
219217
return $feed;
220218
}
@@ -223,7 +221,8 @@ sub _format_release_entries {
223221
my ( $self, $releases ) = @_;
224222
my @release_data;
225223
foreach my $item ( @{$releases} ) {
226-
$item->{link} = join( '/', 'release', $item->{author}, $item->{name} );
224+
$item->{link}
225+
= join( '/', 'release', $item->{author}, $item->{name} );
227226
$item->{name} = "$item->{author} has released $item->{name}";
228227
push( @release_data, $item );
229228
}
@@ -234,8 +233,8 @@ sub _format_favorite_entries {
234233
my ( $self, $author, $data ) = @_;
235234
my @fav_data;
236235
foreach my $fav ( @{$data} ) {
237-
$fav->{abstract} =
238-
"$author ++ed $fav->{distribution} from $fav->{author}";
236+
$fav->{abstract}
237+
= "$author ++ed $fav->{distribution} from $fav->{author}";
239238
$fav->{author} = $author;
240239
$fav->{link} = join( '/', 'release', $fav->{distribution} );
241240
$fav->{name} = "$author ++ed $fav->{distribution}";
@@ -248,11 +247,11 @@ sub end : Private {
248247
my ( $self, $c ) = @_;
249248
my $feed = $c->stash->{feed};
250249
$c->detach('/end')
251-
if !$feed;
250+
if !$feed;
252251

253-
# This will only affect if `cdn_max_age` has been set.
254-
# https://www.fastly.com/documentation/guides/concepts/edge-state/cache/stale/
255-
# If it has then do revalidation in the background
252+
# This will only affect if `cdn_max_age` has been set.
253+
# https://www.fastly.com/documentation/guides/concepts/edge-state/cache/stale/
254+
# If it has then do revalidation in the background
256255
$c->cdn_stale_while_revalidate('1d');
257256

258257
# And if there is still an error serve from cache

0 commit comments

Comments
 (0)