Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use MetaCPAN::Types
  • Loading branch information
mickeyn committed Apr 18, 2016
1 parent 259f6ef commit 9e491b8
Show file tree
Hide file tree
Showing 27 changed files with 98 additions and 78 deletions.
7 changes: 4 additions & 3 deletions lib/Catalyst/Authentication/Store/Proxy.pm
Expand Up @@ -3,16 +3,17 @@ package Catalyst::Authentication::Store::Proxy;
# ABSTRACT: Delegates authentication logic to the user object
use Moose;
use Catalyst::Utils;
use MetaCPAN::Types qw( HashRef Str );

has user_class => (
is => 'ro',
required => 1,
isa => 'Str',
isa => Str,
lazy => 1,
builder => '_build_user_class'
);
has handles => ( is => 'ro', isa => 'HashRef' );
has config => ( is => 'ro', isa => 'HashRef' );
has handles => ( is => 'ro', isa => HashRef );
has config => ( is => 'ro', isa => HashRef );
has app => ( is => 'ro', isa => 'ClassName' );
has realm => ( is => 'ro' );

Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Document/Author.pm
Expand Up @@ -88,7 +88,7 @@ has location => ( is => 'ro', isa => Location, coerce => 1, required => 0 );

has extra => (
is => 'ro',
isa => 'HashRef',
isa => HashRef,
source_only => 1,
dynamic => 1,
required => 0,
Expand Down
5 changes: 3 additions & 2 deletions lib/MetaCPAN/Document/Author/Profile.pm
Expand Up @@ -9,16 +9,17 @@ use ElasticSearchX::Model::Document;
with 'ElasticSearchX::Model::Document::EmbeddedRole';

use MetaCPAN::Util;
use MetaCPAN::Types qw( Str );

has name => (
is => 'ro',
isa => 'Str',
isa => Str,
required => 1,
);

has id => (
is => 'ro',
isa => 'Str',
isa => Str,
analyzer => ['simple'],
);

Expand Down
1 change: 1 addition & 0 deletions lib/MetaCPAN/Document/Dependency.pm
Expand Up @@ -9,6 +9,7 @@ use ElasticSearchX::Model::Document;
with 'ElasticSearchX::Model::Document::EmbeddedRole';

use MetaCPAN::Util;
use MetaCPAN::Types qw( Str );

has [qw(phase relationship module version)] => ( is => 'ro', required => 1 );

Expand Down
24 changes: 12 additions & 12 deletions lib/MetaCPAN/Document/File.pm
Expand Up @@ -209,7 +209,7 @@ File is binary or not.

has binary => (
is => 'ro',
isa => 'Bool',
isa => Bool,
required => 1,
default => 0,
);
Expand All @@ -223,7 +223,7 @@ See L</set_authorized>.
has authorized => (
required => 1,
is => 'rw',
isa => 'Bool',
isa => Bool,
default => 1,
);

Expand All @@ -249,7 +249,7 @@ Return true if this object represents a directory.
has directory => (
is => 'ro',
required => 1,
isa => 'Bool',
isa => Bool,
default => 0,
);

Expand Down Expand Up @@ -312,7 +312,7 @@ not. See L</set_indexed> for a more verbose explanation.
has indexed => (
required => 1,
is => 'rw',
isa => 'Bool',
isa => Bool,
lazy => 1,
default => sub {
my ($self) = @_;
Expand All @@ -331,7 +331,7 @@ has a level of C<0>).

has level => (
is => 'ro',
isa => 'Int',
isa => Int,
lazy => 1,
builder => '_build_level',
);
Expand All @@ -351,7 +351,7 @@ are removed to save space and for better snippet previews.

has pod => (
is => 'ro',
isa => 'ScalarRef',
isa => ScalarRef,
lazy => 1,
builder => '_build_pod',
index => 'analyzed',
Expand Down Expand Up @@ -428,7 +428,7 @@ ArrayRef of ArrayRefs of offset and length of pod blocks. Example:

has pod_lines => (
is => 'ro',
isa => 'ArrayRef',
isa => ArrayRef,
type => 'integer',
lazy => 1,
builder => '_build_pod_lines',
Expand All @@ -452,7 +452,7 @@ L</content> and returns the number of lines.

has sloc => (
is => 'ro',
isa => 'Int',
isa => Int,
lazy => 1,
builder => '_build_sloc',
);
Expand Down Expand Up @@ -487,7 +487,7 @@ Source Lines of Pod. Returns the number of pod lines using L</pod_lines>.

has slop => (
is => 'ro',
isa => 'Int',
isa => Int,
lazy => 1,
default => '_build_slop',
writer => '_set_slop',
Expand Down Expand Up @@ -539,7 +539,7 @@ version could not be parsed.

has version_numified => (
is => 'ro',
isa => 'Num',
isa => Num,
lazy => 1,
builder => '_build_version_numified',
);
Expand Down Expand Up @@ -585,7 +585,7 @@ sub _build_path {

has dir => (
is => 'ro',
isa => 'Str',
isa => Str,
lazy => 1,
builder => '_build_dir',
index => 'not_analyzed'
Expand Down Expand Up @@ -618,7 +618,7 @@ Built by calling L</content_cb>.

has content => (
is => 'ro',
isa => 'ScalarRef',
isa => ScalarRef,
lazy => 1,
builder => '_build_content',
property => 0,
Expand Down
6 changes: 3 additions & 3 deletions lib/MetaCPAN/Document/Module.pm
Expand Up @@ -8,7 +8,7 @@ use ElasticSearchX::Model::Document;

with 'ElasticSearchX::Model::Document::EmbeddedRole';

use MetaCPAN::Types qw(AssociatedPod);
use MetaCPAN::Types qw( AssociatedPod Bool Str );
use MetaCPAN::Util;

=head1 SYNOPSIS
Expand Down Expand Up @@ -72,14 +72,14 @@ has version => ( is => 'ro' );
has indexed => (
is => 'rw',
required => 1,
isa => 'Bool',
isa => Bool,
default => 0,
);

has authorized => (
is => 'rw',
required => 1,
isa => 'Bool',
isa => Bool,
default => 1,
);

Expand Down
18 changes: 9 additions & 9 deletions lib/MetaCPAN/Document/Release.pm
Expand Up @@ -103,8 +103,8 @@ This is an ArrayRef of modules that are included in this release.
=cut

has provides => (
isa => 'ArrayRef[Str]',
is => 'rw',
isa => ArrayRef [Str],
is => 'rw',
);

has id => (
Expand All @@ -119,7 +119,7 @@ has [qw(version author archive)] => (

has license => (
is => 'ro',
isa => 'ArrayRef',
isa => ArrayRef,
required => 1,
);

Expand All @@ -143,7 +143,7 @@ has [qw(distribution name)] => (

has version_numified => (
is => 'ro',
isa => 'Num',
isa => Num,
lazy => 1,
builder => '_build_version_numified',
);
Expand Down Expand Up @@ -202,35 +202,35 @@ has tests => (
has authorized => (
is => 'rw',
required => 1,
isa => 'Bool',
isa => Bool,
default => 1,
);

has first => (
is => 'rw',
required => 1,
isa => 'Bool',
isa => Bool,
lazy => 1,
builder => '_build_first',
);

has metadata => (
coerce => 1,
is => 'ro',
isa => 'HashRef',
isa => HashRef,
dynamic => 1,
source_only => 1,
);

has main_module => (
is => 'rw',
isa => 'Str',
isa => Str,
required => 0,
);

has changes_file => (
is => 'rw',
isa => 'Str',
isa => Str,
required => 0,
);

Expand Down
4 changes: 2 additions & 2 deletions lib/MetaCPAN/Model/Archive.pm
Expand Up @@ -3,7 +3,7 @@ package MetaCPAN::Model::Archive;
use v5.10;
use Moose;
use MooseX::StrictConstructor;
use MetaCPAN::Types qw(AbsFile AbsDir Bool);
use MetaCPAN::Types qw(AbsFile AbsDir ArrayRef Bool);

use Archive::Any;
use Carp;
Expand Down Expand Up @@ -112,7 +112,7 @@ A list of the files in the archive as an array ref.
# A cheap way to cache the result.
has files => (
is => 'ro',
isa => 'ArrayRef',
isa => ArrayRef,
init_arg => undef,
lazy => 1,
default => sub {
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Model/User/Account.pm
Expand Up @@ -91,7 +91,7 @@ is true if the user is connected to a PAUSE account or he L</passed_captcha>.

has looks_human => (
is => 'ro',
isa => 'Bool',
isa => Bool,
lazy => 1,
builder => '_build_looks_human',
clearer => 'clear_looks_human',
Expand Down
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Model/User/Identity.pm
Expand Up @@ -5,6 +5,7 @@ use warnings;

use Moose;
use ElasticSearchX::Model::Document;
use MetaCPAN::Types qw( HashRef );

has name => (
is => 'ro',
Expand All @@ -15,7 +16,7 @@ has key => ( is => 'ro' );

has extra => (
is => 'ro',
isa => 'HashRef',
isa => HashRef,
source_only => 1,
dynamic => 1,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Role/Logger.pm
Expand Up @@ -9,7 +9,7 @@ use Path::Class ();

has level => (
is => 'ro',
isa => 'Str',
isa => Str,
required => 1,
trigger => \&set_level,
documentation => 'Log level',
Expand Down
6 changes: 3 additions & 3 deletions lib/MetaCPAN/Role/Script.pm
Expand Up @@ -48,13 +48,13 @@ has model => (
has index => (
reader => '_index',
is => 'ro',
isa => 'Str',
isa => Str,
default => 'cpan',
documentation => 'Index to use, defaults to "cpan"',
);

has port => (
isa => 'Int',
isa => Int,
is => 'ro',
required => 1,
documentation => 'Port for the proxy, defaults to 5000',
Expand All @@ -69,7 +69,7 @@ has home => (

has config => (
is => 'ro',
isa => 'HashRef',
isa => HashRef,
lazy => 1,
builder => '_build_config',
);
Expand Down
11 changes: 6 additions & 5 deletions lib/MetaCPAN/Script/Check.pm
Expand Up @@ -6,41 +6,42 @@ use warnings;
use File::Spec::Functions qw(catfile);
use Log::Contextual qw( :log );
use Moose;
use MetaCPAN::Types qw( Bool Int Str );

with 'MetaCPAN::Role::Script', 'MooseX::Getopt';

has modules => (
is => 'ro',
isa => 'Bool',
isa => Bool,
default => 0,
documentation => 'check CPAN packages against MetaCPAN',
);

has module => (
is => 'ro',
isa => 'Str',
isa => Str,
default => '',
documentation => 'the name of the module you are checking',
);

has max_errors => (
is => 'ro',
isa => 'Int',
isa => Int,
default => 0,
documentation =>
'the maximum number of errors to encounter before stopping',
);

has errors_only => (
is => 'ro',
isa => 'Bool',
isa => Bool,
default => 0,
documentation => 'just show errors',
);

has error_count => (
is => 'rw',
isa => 'Int',
isa => Int,
default => 0,
traits => ['NoGetopt']
);
Expand Down

0 comments on commit 9e491b8

Please sign in to comment.