File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 11package MetaCPAN::API::Model::Download ;
22
3- use Mojo::Base -base ;
3+ use MetaCPAN::Moose ;
44
5- use Carp ( );
5+ use MetaCPAN::Types qw( Object ) ;
66
7- has es => sub { Carp::croak ' es is required' };
7+ has es => (
8+ is => ' ro' ,
9+ isa => Object,
10+ handles => { _run_query => ' search' , },
11+ required => 1,
12+ );
13+
14+ __PACKAGE__ -> meta-> make_immutable;
815
9161;
1017
Original file line number Diff line number Diff line change 1- package MetaCPAN::Model::User ;
1+ package MetaCPAN::API:: Model::User ;
22
33use MetaCPAN::Moose;
44
5- use Log::Contextual qw( :log :dlog ) ;
6- use MooseX::StrictConstructor;
7-
85use MetaCPAN::Types qw( Object ) ;
96
107# use MetaCPAN::Util qw( single_valued_arrayref_to_scalar );
@@ -38,5 +35,7 @@ sub lookup {
3835 return $res -> {hits }{hits }[0]{_source };
3936}
4037
38+ __PACKAGE__ -> meta-> make_immutable;
39+
41401;
4241
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ use Carp ();
66
77# Models from the catalyst app
88use MetaCPAN::Model::Search ();
9- use MetaCPAN::Model::User ();
109
1110# New models
11+ use MetaCPAN::API::Model::User ();
1212use MetaCPAN::API::Model::Download ();
1313
1414has app => sub { Carp::croak ' app is required' }, weak => 1;
@@ -28,7 +28,7 @@ has search => sub {
2828
2929has user => sub {
3030 my $self = shift ;
31- return MetaCPAN::Model::User-> new( es => $self -> app-> es );
31+ return MetaCPAN::API:: Model::User-> new( es => $self -> app-> es );
3232};
3333
3434sub register {
You can’t perform that action at this time.
0 commit comments