Skip to content

Commit 8c408b0

Browse files
committed
Tidy some files
1 parent 40607b3 commit 8c408b0

File tree

8 files changed

+49
-39
lines changed

8 files changed

+49
-39
lines changed

app.psgi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use Config::ZOMG ();
1212
use Log::Log4perl ();
1313
use Log::Log4perl::MDC ();
1414
use File::Spec ();
15-
use File::Path ();
1615
use Plack::Builder qw( builder enable );
1716
use Digest::SHA ();
1817

@@ -46,7 +45,7 @@ BEGIN {
4645
}
4746

4847
use lib "$root_dir/lib";
49-
use MetaCPAN::Web;
48+
use MetaCPAN::Web ();
5049

5150
STDERR->autoflush;
5251

lib/MetaCPAN/Middleware/Static.pm

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package MetaCPAN::Middleware::Static;
22
use strict;
33
use warnings;
4-
use Plack::Builder qw( builder enable mount );
5-
use Plack::App::File ();
6-
use JavaScript::Minifier::XS ();
7-
use Cwd qw( cwd );
8-
use Plack::MIME ();
9-
use JSON::MaybeXS ();
4+
use Plack::Builder qw( builder enable mount );
5+
use Plack::App::File ();
6+
use Cwd qw( cwd );
7+
use Plack::MIME ();
8+
use JSON::MaybeXS ();
109

1110
Plack::MIME->add_type(
1211
'.eot' => 'application/vnd.ms-fontobject',

lib/MetaCPAN/Web/Controller/About.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package MetaCPAN::Web::Controller::About;
22

33
use Moose;
44

5-
use Cpanel::JSON::XS qw(encode_json);
5+
use Cpanel::JSON::XS qw( encode_json );
66

77
BEGIN { extends 'MetaCPAN::Web::Controller' }
88

lib/MetaCPAN/Web/Controller/Feed.pm

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ use namespace::autoclean;
55

66
BEGIN { extends 'MetaCPAN::Web::Controller' }
77

8-
use DateTime ();
9-
use HTML::Escape qw( escape_html );
10-
use MetaCPAN::Web::Types qw( ArrayRef Enum HashRef Str Undef Uri DateTime );
8+
use DateTime ();
9+
use HTML::Escape qw( escape_html );
10+
use MetaCPAN::Web::RenderUtil qw( render_markdown );
11+
use MetaCPAN::Web::Types qw( ArrayRef DateTime Enum HashRef Str Undef Uri );
1112
use Params::ValidationCompiler qw( validation_for );
1213
use Path::Tiny qw( path );
13-
use MetaCPAN::Web::RenderUtil qw( render_markdown );
14+
use XML::FeedPP::RDF ();
15+
use XML::FeedPP::RSS ();
16+
use XML::FeedPP::Atom::Atom10 ();
1417
use URI ();
15-
use XML::FeedPP ();
1618

1719
sub recent_rdf : Path('/recent.rdf') Args(0) {
1820
my ( $self, $c ) = @_;
@@ -248,14 +250,12 @@ sub build_feed {
248250
my $self = shift;
249251
my %params = $feed_check->(@_);
250252

251-
my $format
252-
= $params{format} eq 'rdf' ? 'RDF'
253-
: $params{format} eq 'rss' ? 'RSS'
254-
: $params{format} eq 'atom' ? 'Atom::Atom10'
253+
my $feed_class
254+
= $params{format} eq 'rdf' ? XML::FeedPP::RDF::
255+
: $params{format} eq 'rss' ? XML::FeedPP::RSS::
256+
: $params{format} eq 'atom' ? XML::FeedPP::Atom::Atom10::
255257
: die 'invalid format';
256258

257-
my $feed_class = "XML::FeedPP::$format";
258-
259259
my $feed = $feed_class->new;
260260
$feed->title( $params{title} );
261261
$feed->link("$params{link}");

lib/MetaCPAN/Web/Model/API/Pod.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package MetaCPAN::Web::Model::API::Pod;
22
use Moose;
33
use namespace::autoclean;
44

5-
use MetaCPAN::Web::RenderUtil qw( split_index filter_html );
5+
use MetaCPAN::Web::RenderUtil qw( filter_html split_index );
66
use Encode qw( encode );
77
use Future ();
88
use HTML::TokeParser ();

lib/MetaCPAN/Web/Model/GitHub.pm

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ use namespace::autoclean;
77

88
use Cpanel::JSON::XS qw( decode_json encode_json );
99

10-
use IO::Async::Loop ();
11-
use IO::Async::SSL ();
12-
use IO::Socket::SSL qw( SSL_VERIFY_PEER );
13-
use Net::Async::HTTP ();
14-
use HTTP::Request::Common ();
15-
use MIME::Base64 qw(encode_base64url);
16-
use Crypt::OpenSSL::RSA ();
17-
use Ref::Util qw(is_arrayref is_hashref);
10+
use IO::Async::Loop ();
11+
use IO::Socket::SSL qw( SSL_VERIFY_PEER );
12+
use Net::Async::HTTP ();
13+
use MIME::Base64 qw( encode_base64url );
14+
use Crypt::OpenSSL::RSA ();
15+
use Ref::Util qw( is_arrayref is_hashref );
1816

1917
my $loop;
2018

lib/MetaCPAN/Web/RenderUtil.pm

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,20 @@ use HTML::Escape qw( escape_html );
88
use HTML::Restrict ();
99
use URI ();
1010
use Digest::MD5 ();
11-
use CommonMark qw( :node :event );
11+
use CommonMark qw(
12+
EVENT_ENTER
13+
EVENT_EXIT
14+
NODE_CODE
15+
NODE_CODE_BLOCK
16+
NODE_DOCUMENT
17+
NODE_HEADER
18+
NODE_HRULE
19+
NODE_HTML
20+
NODE_INLINE_HTML
21+
NODE_LINEBREAK
22+
NODE_SOFTBREAK
23+
NODE_TEXT
24+
);
1225

1326
our @EXPORT_OK = qw(
1427
filter_html

static-app.psgi

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
use strict;
22
use warnings;
3-
use Plack::Builder;
3+
use Plack::Builder qw( builder enable mount );
44
use Plack::App::Proxy;
5-
use File::Basename;
6-
use Config::ZOMG ();
5+
use File::Basename ();
6+
use Config::ZOMG ();
77

8-
my $root_dir; BEGIN { $root_dir = File::Basename::dirname(__FILE__); }
8+
my $root_dir;
9+
BEGIN { $root_dir = File::Basename::dirname(__FILE__); }
910
use lib "$root_dir/lib";
1011

1112
my $port = $ENV{METACPAN_WEB_PORT} || 5001;
@@ -17,8 +18,8 @@ my $config = Config::ZOMG->open(
1718

1819
builder {
1920
enable '+MetaCPAN::Middleware::Static' => (
20-
root => $root_dir,
21-
config => $config,
21+
root => $root_dir,
22+
config => $config,
2223
dev_mode => 1,
2324
);
2425
enable sub {
@@ -31,10 +32,10 @@ builder {
3132
};
3233
};
3334
mount '/' => Plack::App::Proxy->new(
34-
remote => "http://localhost:$port",
35+
remote => "http://localhost:$port",
3536
preserve_host_header => 1,
36-
backend => 'LWP',
37-
options => {
37+
backend => 'LWP',
38+
options => {
3839
env_proxy => 0,
3940
},
4041
)->to_app;

0 commit comments

Comments
 (0)