Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

moved reverse_dependencies in /search namespace

  • Loading branch information...
commit 0c45936fd77980eb371d49c32a31c0d5247c29bc 1 parent 4943926
@monken monken authored
View
9 lib/MetaCPAN/Server/Controller/Search.pm
@@ -0,0 +1,9 @@
+package MetaCPAN::Server::Controller::Search;
+use Moose;
+BEGIN { extends 'MetaCPAN::Server::Controller' }
+with 'MetaCPAN::Server::Role::JSONP';
+
+sub index : Chained('/') : PathPart('search') : CaptureArgs(0) {
+}
+
+1;
View
9 ...MetaCPAN/Server/Controller/ReverseDependencies.pm → ...N/Server/Controller/Search/ReverseDependencies.pm
@@ -1,12 +1,11 @@
-package MetaCPAN::Server::Controller::ReverseDependencies;
+package MetaCPAN::Server::Controller::Search::ReverseDependencies;
use Moose;
BEGIN { extends 'MetaCPAN::Server::Controller' }
with 'MetaCPAN::Server::Role::JSONP';
-sub index : Chained('/') : PathPart('reverse_dependencies') : CaptureArgs(0) {
-}
+has '+type' => ( default => 'release' );
-sub get : Chained('index') : PathPart('') : Args(2) {
+sub get : Chained('/search/index') : PathPart('reverse_dependencies') : Args(2) {
my ( $self, $c, $author, $release ) = @_;
my @modules = eval {
@@ -23,7 +22,7 @@ sub get : Chained('index') : PathPart('') : Args(2) {
} or $c->detach('/not_found');
}
-sub find : Chained('index') : PathPart('') : Args(1) {
+sub find : Chained('/search/index') : PathPart('reverse_dependencies') : Args(1) {
my ( $self, $c, $name ) = @_;
my $release = eval {
$c->model('CPAN::Release')->inflate(0)->find($name)->{_source}
View
10 t/server/controller/reverse_dependencies.t
@@ -4,16 +4,16 @@ use Test::More;
use MetaCPAN::Server::Test;
my %tests = (
- '/reverse_dependencies/NonExistent' => [ 404 ],
- '/reverse_dependencies/Pod-Pm' => [ 200, [] ],
+ '/search/reverse_dependencies/NonExistent' => [ 404 ],
+ '/search/reverse_dependencies/Pod-Pm' => [ 200, [] ],
- '/reverse_dependencies/Multiple-Modules' => [ 200,
+ '/search/reverse_dependencies/Multiple-Modules' => [ 200,
[ sort qw(Multiple-Modules-RDeps Multiple-Modules-RDeps-A) ] ],
- '/reverse_dependencies/LOCAL/Multiple-Modules-1.01' => [ 200,
+ '/search/reverse_dependencies/LOCAL/Multiple-Modules-1.01' => [ 200,
[ sort qw(Multiple-Modules-RDeps Multiple-Modules-RDeps-A) ] ],
- '/reverse_dependencies/LOCAL/Multiple-Modules-0.1' => [ 200,
+ '/search/reverse_dependencies/LOCAL/Multiple-Modules-0.1' => [ 200,
[ sort qw(Multiple-Modules-RDeps Multiple-Modules-RDeps-Deprecated) ] ],
);
Please sign in to comment.
Something went wrong with that request. Please try again.