Skip to content

Commit

Permalink
Merge pull request #437 from CPAN-API/oalders/upgrade-catalyst
Browse files Browse the repository at this point in the history
Upgrade Catalyst
  • Loading branch information
oalders committed Mar 14, 2016
2 parents 76964c6 + e403231 commit 4d65111
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 54 deletions.
6 changes: 5 additions & 1 deletion .github/CONTRIBUTING.md
Expand Up @@ -2,7 +2,11 @@

We are always after more contributors and suggestions.

## Suggestions or issues with metacpan...
### How can I help?

The following issues are tagged as [Volunteer needed](https://github.com/CPAN-API/cpan-api/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3A%22Volunteer+needed%22+no%3Aassignee+)

## Suggestions or issues with MetaCPAN...

#### Does it relate to our API (backend)... ?

Expand Down
3 changes: 2 additions & 1 deletion cpanfile
Expand Up @@ -8,7 +8,7 @@ requires 'CPAN::DistnameInfo', '0.12';
requires 'CPAN::Meta', '2.115005'; # Avoid issues with List::Util dep under carton install.
requires 'CPAN::Meta::Requirements', '2.140';
requires 'Captcha::reCAPTCHA', '0.94';
requires 'Catalyst', '5.90011';
requires 'Catalyst', '5.90103';
requires 'Catalyst::Action::RenderView';
requires 'Catalyst::Authentication::User';
requires 'Catalyst::Controller';
Expand Down Expand Up @@ -159,6 +159,7 @@ requires 'warnings';

test_requires 'App::Prove';
test_requires 'CPAN::Faker', '0.010';
test_requires 'Devel::Confess';
test_requires 'Module::Faker', '0.015';
test_requires 'Module::Faker::Dist', '0.010';
test_requires 'Config::General';
Expand Down
102 changes: 68 additions & 34 deletions cpanfile.snapshot
Expand Up @@ -764,15 +764,17 @@ DISTRIBUTIONS
MooseX::Types 0
Test::More 0
namespace::autoclean 0
Catalyst-Runtime-5.90064
pathname: J/JJ/JJNAPIORK/Catalyst-Runtime-5.90064.tar.gz
Catalyst-Runtime-5.90103
pathname: M/MS/MSTROUT/Catalyst-Runtime-5.90103.tar.gz
provides:
Catalyst 5.90064
Catalyst 5.90103
Catalyst::Action undef
Catalyst::ActionChain undef
Catalyst::ActionContainer undef
Catalyst::ActionRole::ConsumesContent undef
Catalyst::ActionRole::HTTPMethods undef
Catalyst::ActionRole::QueryMatching undef
Catalyst::ActionRole::Scheme undef
Catalyst::Base undef
Catalyst::ClassData undef
Catalyst::Component undef
Expand All @@ -794,12 +796,15 @@ DISTRIBUTIONS
Catalyst::Exception::Go undef
Catalyst::Exception::Interface undef
Catalyst::Log undef
Catalyst::Middleware::Stash undef
Catalyst::Model undef
Catalyst::Plugin::Unicode::Encoding 2.1
Catalyst::Plugin::Unicode::Encoding 99.0
Catalyst::Request undef
Catalyst::Request::PartData undef
Catalyst::Request::Upload undef
Catalyst::Response undef
Catalyst::Runtime 5.90064
Catalyst::Response::Writer undef
Catalyst::Runtime 5.90103
Catalyst::Script::CGI undef
Catalyst::Script::Create undef
Catalyst::Script::FastCGI undef
Expand All @@ -814,7 +819,7 @@ DISTRIBUTIONS
requirements:
CGI::Simple::Cookie 1.109
CGI::Struct 0
Carp 0
Carp 1.25
Class::C3::Adopt::NEXT 0.07
Class::Data::Inheritable 0
Class::Load 0.12
Expand All @@ -825,7 +830,7 @@ DISTRIBUTIONS
ExtUtils::MakeMaker 6.59
HTML::Entities 0
HTML::HeadParser 0
HTTP::Body 1.06
HTTP::Body 1.22
HTTP::Headers 1.64
HTTP::Request 5.814
HTTP::Request::AsCGI 1.0
Expand Down Expand Up @@ -854,7 +859,7 @@ DISTRIBUTIONS
Plack::Middleware::IIS6ScriptNameFix 0
Plack::Middleware::IIS7KeepAliveFix 0
Plack::Middleware::LighttpdScriptNameFix 0
Plack::Middleware::MethodOverride 0
Plack::Middleware::MethodOverride 0.12
Plack::Middleware::RemoveRedundantBody 0.03
Plack::Middleware::ReverseProxy 0.04
Plack::Request::Upload 0
Expand All @@ -873,8 +878,9 @@ DISTRIBUTIONS
Tree::Simple 1.15
Tree::Simple::Visitor::FindByPath 0
Try::Tiny 0.17
URI 1.36
namespace::autoclean 0.09
URI 1.65
URI::ws 0.03
namespace::autoclean 0.28
namespace::clean 0.23
perl 5.008003
Catalyst-View-JSON-0.36
Expand Down Expand Up @@ -2698,6 +2704,18 @@ DISTRIBUTIONS
IO::CaptureOutput 1.0801
Test::More 0.62
perl 5.00405
Devel-Confess-0.008000
pathname: H/HA/HAARG/Devel-Confess-0.008000.tar.gz
provides:
Devel::Confess 0.008000
Devel::Confess::Builtin 0.008000
Devel::Confess::Source undef
Devel::Confess::_Util undef
requirements:
Carp 0
ExtUtils::MakeMaker 0
Scalar::Util 0
perl 5.006000
Devel-GlobalDestruction-0.12
pathname: H/HA/HAARG/Devel-GlobalDestruction-0.12.tar.gz
provides:
Expand Down Expand Up @@ -3640,20 +3658,20 @@ DISTRIBUTIONS
base 0
integer 0
perl 5.008
HTTP-Body-1.19
pathname: G/GE/GETTY/HTTP-Body-1.19.tar.gz
provides:
HTTP::Body 1.19
HTTP::Body::MultiPart 1.19
HTTP::Body::OctetStream 1.19
HTTP::Body::UrlEncoded 1.19
HTTP::Body::XForms 1.19
HTTP::Body::XFormsMultipart 1.19
HTTP-Body-1.22
pathname: G/GE/GETTY/HTTP-Body-1.22.tar.gz
provides:
HTTP::Body 1.22
HTTP::Body::MultiPart 1.22
HTTP::Body::OctetStream 1.22
HTTP::Body::UrlEncoded 1.22
HTTP::Body::XForms 1.22
HTTP::Body::XFormsMultipart 1.22
PAML undef
requirements:
Carp 0
Digest::MD5 0
ExtUtils::MakeMaker 6.30
ExtUtils::MakeMaker 0
File::Temp 0.14
HTTP::Headers 0
IO::File 1.14
Expand Down Expand Up @@ -6663,17 +6681,19 @@ DISTRIBUTIONS
Test::More 0
parent 0
perl 5.008001
Plack-Middleware-MethodOverride-0.10
pathname: D/DW/DWHEELER/Plack-Middleware-MethodOverride-0.10.tar.gz
Plack-Middleware-MethodOverride-0.15
pathname: D/DW/DWHEELER/Plack-Middleware-MethodOverride-0.15.tar.gz
provides:
Plack::Middleware::MethodOverride 0.10
Plack::Middleware::MethodOverride 0.15
requirements:
Module::Build 0.30
Plack 0.9929
Test::Builder 0.70
Test::More 0.70
URI 0
ExtUtils::MakeMaker 0
Plack::Middleware 0
Plack::Request 0
Plack::Util::Accessor 0
parent 0
perl 5.008001
strict 0
warnings 0
Plack-Middleware-RemoveRedundantBody-0.05
pathname: S/SW/SWEETKID/Plack-Middleware-RemoveRedundantBody-0.05.tar.gz
provides:
Expand Down Expand Up @@ -7120,6 +7140,13 @@ DISTRIBUTIONS
requirements:
ExtUtils::MakeMaker 0
Test::More 0.88
Sub-Identify-0.12
pathname: R/RG/RGARCIA/Sub-Identify-0.12.tar.gz
provides:
Sub::Identify 0.12
requirements:
ExtUtils::MakeMaker 0
Test::More 0
Sub-Install-0.927
pathname: R/RJ/RJBS/Sub-Install-0.927.tar.gz
provides:
Expand Down Expand Up @@ -8021,6 +8048,14 @@ DISTRIBUTIONS
URI::QueryParam 0
strict 0
warnings 0
URI-ws-0.03
pathname: P/PL/PLICEASE/URI-ws-0.03.tar.gz
provides:
URI::ws 0.03
URI::wss 0.03
requirements:
ExtUtils::MakeMaker 6.30
URI 0
Unicode-LineBreak-2015.12
pathname: N/NE/NEZUMI/Unicode-LineBreak-2015.12.tar.gz
provides:
Expand Down Expand Up @@ -8484,16 +8519,15 @@ DISTRIBUTIONS
XSLoader 0
strict 0
warnings 0
namespace-autoclean-0.15
pathname: E/ET/ETHER/namespace-autoclean-0.15.tar.gz
namespace-autoclean-0.28
pathname: E/ET/ETHER/namespace-autoclean-0.28.tar.gz
provides:
namespace::autoclean 0.15
namespace::autoclean 0.28
requirements:
B::Hooks::EndOfScope 0.12
Class::MOP 0.80
ExtUtils::MakeMaker 6.30
ExtUtils::MakeMaker 0
List::Util 0
Module::Build::Tiny 0.030
Sub::Identify 0
namespace::clean 0.20
perl 5.006
strict 0
Expand Down
7 changes: 5 additions & 2 deletions lib/MetaCPAN/Server.pm
Expand Up @@ -12,8 +12,11 @@ use Plack::Middleware::ServerStatus::Lite;

extends 'Catalyst';

has api => ( is => 'ro' );
has '+stash' => ( clearer => 'clear_stash' );
has api => ( is => 'ro' );

sub clear_stash {
%{ $_[0]->stash } = ();
}

__PACKAGE__->apply_request_class_roles(
qw(
Expand Down
4 changes: 3 additions & 1 deletion lib/MetaCPAN/Server/Controller/File.pm
Expand Up @@ -37,7 +37,9 @@ sub find : Path('') {
path => join( '/', @path )
}
);
$c->stash( $file->{_source} || $file->{fields} );
if ( $file->{_source} || $file->{fields} ) {
$c->stash( $file->{_source} || $file->{fields} );
}
} or $c->detach( '/not_found', [$@] );
}

Expand Down
19 changes: 4 additions & 15 deletions t/server/controller/source.t
Expand Up @@ -21,11 +21,7 @@ test_psgi app, sub {
is( $res->code, $v, "code $v" );
if ( $k eq '/source/Moose' ) {
like( $res->content, qr/package Moose/, 'Moose source' );
is(
$res->header('content-type'),
'text/plain; charset=UTF-8',
'Content-type'
);
is( $res->header('content-type'), 'text/plain', 'Content-type' );

# Used for fastly on st.aticpan.org
is( $res->header('X-Content-Type'),
Expand Down Expand Up @@ -68,19 +64,12 @@ test_psgi app, sub {
}
else {
is( $res->content, $manifest, 'Plain text manifest' );
is(
$res->header('content-type'),
'text/plain; charset=UTF-8',
'Content-type'
);
is( $res->header('content-type'),
'text/plain', 'Content-type' );
}
}
elsif ( $k eq '/source/DOY/Moose-0.01/Changes' ) {
is(
$res->header('content-type'),
'text/plain; charset=UTF-8',
'Content-type'
);
is( $res->header('content-type'), 'text/plain', 'Content-type' );
like(
$res->decoded_content,
qr/codename 'M\x{fc}nchen'/,
Expand Down

0 comments on commit 4d65111

Please sign in to comment.