MooseX-AttributeShortcuts-0.037/0000750000175100017510000000000013204655723016475 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/lib/0000750000175100017510000000000013204655723017243 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/lib/MooseX/0000750000175100017510000000000013204655723020455 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/0000750000175100017510000000000013204655723024337 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/0000750000175100017510000000000013204655723025422 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Attribute/0000750000175100017510000000000013204655723027365 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Attribute/HasAnonBuilder.pm0000640000175100017510000000706013204655723032565 0ustar maxmindmaxmind# # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package MooseX::AttributeShortcuts::Trait::Attribute::HasAnonBuilder; our $AUTHORITY = 'cpan:RSRCHBOY'; $MooseX::AttributeShortcuts::Trait::Attribute::HasAnonBuilder::VERSION = '0.037'; # ABSTRACT: Attributes, etc, common to both the role-attribute and attribute traits use Moose::Role; use namespace::autoclean 0.24; has anon_builder => ( reader => 'anon_builder', writer => '_set_anon_builder', isa => 'CodeRef', predicate => 'has_anon_builder', # init_arg => '_anon_builder', ); has anon_builder_installed => ( traits => ['Bool'], is => 'ro', default => 0, handles => { _set_anon_builder_installed => 'set', }, ); # FIXME Something Odd keeps this from succeeding as we'd like. #requires 'canonical_builder_prefix'; sub _mxas_builder_name { my ($class, $name) = @_; return $class->canonical_builder_prefix . $name; } # this is identical between role and class attributes sub _builder_method_meta { my ($self, $thing) = @_; my $dc = { %{$self->definition_context} }; $dc->{description} = 'builder ' . $thing->name . '::' . $self->builder . ' of attribute ' . $self->name ; return $self->builder_method_metaclass->wrap($self->anon_builder => associated_attribute => $self, associated_metaclass => $thing, name => $self->builder, package_name => $thing->name, definition_context => $dc, ); } !!42; __END__ =pod =encoding UTF-8 =for :stopwords Chris Weyl Alders David Etheridge Graham Karen Knop Olaf Steinbrunner =head1 NAME MooseX::AttributeShortcuts::Trait::Attribute::HasAnonBuilder - Attributes, etc, common to both the role-attribute and attribute traits =head1 VERSION This document describes version 0.037 of MooseX::AttributeShortcuts::Trait::Attribute::HasAnonBuilder - released November 20, 2017 as part of MooseX-AttributeShortcuts. =head1 DESCRIPTION This is a role containing the elements common to both the L and L of L. =head1 ATTRIBUTES =head2 anon_builder CodeRef, read-only. Stores the code reference that will become the attribute's builder. This code reference will be installed in the role or class as a method, as appropriate. =head2 anon_builder_installed Boolean, read-only. If true, the code reference in L has been installed as a method. =head1 METHODS =head2 has_anon_builder Predicate for L. =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Chris Weyl =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut MooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Role/0000750000175100017510000000000013204655723026323 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Role/Method/0000750000175100017510000000000013204655723027543 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Role/Method/Builder.pm0000640000175100017510000000460213204655723031472 0ustar maxmindmaxmind# # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package MooseX::AttributeShortcuts::Trait::Role::Method::Builder; our $AUTHORITY = 'cpan:RSRCHBOY'; $MooseX::AttributeShortcuts::Trait::Role::Method::Builder::VERSION = '0.037'; # ABSTRACT: Trait for inline builder method metaclasses use Moose::Role; use namespace::autoclean; with 'MooseX::AttributeShortcuts::Trait::Method::HasDefinitionContext'; has associated_attribute => ( is => 'ro', isa => 'Moose::Meta::Role::Attribute', required => 1, weak_ref => 1, ); !!42; __END__ =pod =encoding UTF-8 =for :stopwords Chris Weyl Alders David Etheridge Graham Karen Knop Olaf Steinbrunner =head1 NAME MooseX::AttributeShortcuts::Trait::Role::Method::Builder - Trait for inline builder method metaclasses =head1 VERSION This document describes version 0.037 of MooseX::AttributeShortcuts::Trait::Role::Method::Builder - released November 20, 2017 as part of MooseX-AttributeShortcuts. =head1 DESCRIPTION This is a L trait that allows inline builder methods to be associated with their attribute, and to take on a definition context. This additional information will allow inline builders to be more readily identified and associated with their owning attributes. =head1 ATTRIBUTES =head2 associated_attribute Read only, required, weak, must be a L or descendant. Contains the attribute this builder is associated with. =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Chris Weyl =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut MooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Role/Attribute.pm0000640000175100017510000001147313204655723030633 0ustar maxmindmaxmind# # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package MooseX::AttributeShortcuts::Trait::Role::Attribute; our $AUTHORITY = 'cpan:RSRCHBOY'; $MooseX::AttributeShortcuts::Trait::Role::Attribute::VERSION = '0.037'; # ABSTRACT: Role attribute trait to create builder method use MooseX::Role::Parameterized; use namespace::autoclean 0.24; use MooseX::Types::Common::String ':all'; use MooseX::Util; use aliased 'MooseX::AttributeShortcuts::Trait::Role::Method::Builder' => 'RoleBuilderTrait'; with 'MooseX::AttributeShortcuts::Trait::Attribute::HasAnonBuilder'; parameter builder_prefix => (isa => NonEmptySimpleStr, default => '_build_'); sub builder_method_metaclass { my $self = shift @_; # this mirrors the approach taken by # Moose::Meta::Role::Attribute->attribute_for_class() return with_traits( $self->original_role->method_metaclass, RoleBuilderTrait, ); } # no POD, as this is "private". If a role is composed into another role, the # role attributes are cloned into the new role using original_options. In # order to prevent us from installing the same build method twice, we poke at # original_options to ensure the information is propagated correctly. after _set_anon_builder_installed => sub { my $self = shift; $self->original_options->{anon_builder_installed} = 1; return; }; after attach_to_role => sub { my ($self, $role) = @_; ### has anon builder?: $self->has_anon_builder return unless $self->has_anon_builder && !$self->anon_builder_installed; ### install our anon builder as a method: $role->name $role->add_method($self->builder => $self->_builder_method_meta($role)); $self->_set_anon_builder_installed; return; }; role { my $p = shift @_; method canonical_builder_prefix => sub { $p->builder_prefix }; around new => sub { # my ($orig, $class) = (shift, shift); my ($orig, $class, $name, %options) = @_; # just pass to the original new() if we don't have an anon builder return $class->$orig($name => %options) unless exists $options{builder} && (ref $options{builder} || q{}) eq 'CODE'; # stash anon_builder, set builder => 1 $options{anon_builder} = $options{builder}; $options{builder} = $class->_mxas_builder_name($name); ### %options ### anon builder: $options{builder} return $class->$orig($name => %options); }; }; !!42; __END__ =pod =encoding UTF-8 =for :stopwords Chris Weyl Alders David Etheridge Graham Karen Knop Olaf Steinbrunner =head1 NAME MooseX::AttributeShortcuts::Trait::Role::Attribute - Role attribute trait to create builder method =head1 VERSION This document describes version 0.037 of MooseX::AttributeShortcuts::Trait::Role::Attribute - released November 20, 2017 as part of MooseX-AttributeShortcuts. =head1 DESCRIPTION Normally, attribute options processing takes place at the time an attribute is created and attached to a class, either by virtue of a C statement in a class definition or when a role is applied to a class. This is not an optimal approach for inline builder methods. This is a role attribute trait, to create builder methods when role attributes are created, so that they can be aliased, excluded, etc, like any other role method. =head1 ROLE PARAMETERS Parameterized roles accept parameters that influence their construction. This role accepts the following parameters. =head2 builder_prefix =head1 AROUND METHOD MODIFIERS =head2 new If we have an inline builder defined in our role options, swizzle our options such that C becomes the builder method name, and C is the anonymous sub. =head1 AFTER METHOD MODIFIERS =head2 attach_to_role If we have an inline builder defined in our role options, install it as a method. =head1 METHODS =head2 builder_method_metaclass() Returns the metaclass we'll use to install a inline builder. =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Chris Weyl =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut MooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Method/0000750000175100017510000000000013204655723026642 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Method/HasDefinitionContext.pm0000640000175100017510000000450013204655723033271 0ustar maxmindmaxmind# # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package MooseX::AttributeShortcuts::Trait::Method::HasDefinitionContext; our $AUTHORITY = 'cpan:RSRCHBOY'; $MooseX::AttributeShortcuts::Trait::Method::HasDefinitionContext::VERSION = '0.037'; # ABSTRACT: Trait for method metaclasses that have definition contexts use Moose::Role; use namespace::autoclean; has definition_context => ( is => 'ro', isa => 'HashRef', required => 1, ); !!42; __END__ =pod =encoding UTF-8 =for :stopwords Chris Weyl Alders David Etheridge Graham Karen Knop Olaf Steinbrunner =head1 NAME MooseX::AttributeShortcuts::Trait::Method::HasDefinitionContext - Trait for method metaclasses that have definition contexts =head1 VERSION This document describes version 0.037 of MooseX::AttributeShortcuts::Trait::Method::HasDefinitionContext - released November 20, 2017 as part of MooseX-AttributeShortcuts. =head1 DESCRIPTION This is a L trait that allows inline builder methods to be associated with their attribute, and to take on a definition context. This additional information will allow inline builders to be more readily identified and associated with their owning attributes. =head1 ATTRIBUTES =head2 definition_context Read only, required, must be a reference to a hash. This is the definition context of this method; e.g. where it was defined and to what. =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Chris Weyl =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut MooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Method/Builder.pm0000640000175100017510000000453113204655723030572 0ustar maxmindmaxmind# # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package MooseX::AttributeShortcuts::Trait::Method::Builder; our $AUTHORITY = 'cpan:RSRCHBOY'; $MooseX::AttributeShortcuts::Trait::Method::Builder::VERSION = '0.037'; # ABSTRACT: Trait for inline builder method metaclasses use Moose::Role; use namespace::autoclean; with 'MooseX::AttributeShortcuts::Trait::Method::HasDefinitionContext'; has associated_attribute => ( is => 'ro', isa => 'Moose::Meta::Attribute', required => 1, weak_ref => 1, ); !!42; __END__ =pod =encoding UTF-8 =for :stopwords Chris Weyl Alders David Etheridge Graham Karen Knop Olaf Steinbrunner =head1 NAME MooseX::AttributeShortcuts::Trait::Method::Builder - Trait for inline builder method metaclasses =head1 VERSION This document describes version 0.037 of MooseX::AttributeShortcuts::Trait::Method::Builder - released November 20, 2017 as part of MooseX-AttributeShortcuts. =head1 DESCRIPTION This is a L trait that allows inline builder methods to be associated with their attribute, and to take on a definition context. This additional information will allow inline builders to be more readily identified and associated with their owning attributes. =head1 ATTRIBUTES =head2 associated_attribute Read only, required, weak, must be a L or descendant. Contains the attribute this builder is associated with. =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Chris Weyl =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut MooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts/Trait/Attribute.pm0000640000175100017510000003536213204655723027735 0ustar maxmindmaxmind# # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package MooseX::AttributeShortcuts::Trait::Attribute; our $AUTHORITY = 'cpan:RSRCHBOY'; $MooseX::AttributeShortcuts::Trait::Attribute::VERSION = '0.037'; # ABSTRACT: Shortcuts attribute trait proper use namespace::autoclean; use MooseX::Role::Parameterized; use Moose::Util::TypeConstraints ':all'; use MooseX::Types::Moose ':all'; use MooseX::Types::Common::String ':all'; use MooseX::Util; use aliased 'MooseX::Meta::TypeConstraint::Mooish' => 'MooishTC'; use aliased 'MooseX::AttributeShortcuts::Trait::Method::Builder' => 'BuilderTrait'; use List::Util 1.33 'any'; # lazy... my $_acquire_isa_tc = sub { goto \&Moose::Util::TypeConstraints::find_or_create_isa_type_constraint }; parameter writer_prefix => (isa => NonEmptySimpleStr, default => '_set_'); parameter builder_prefix => (isa => NonEmptySimpleStr, default => '_build_'); with 'MooseX::AttributeShortcuts::Trait::Attribute::HasAnonBuilder'; has constraint => ( is => 'ro', isa => 'CodeRef', predicate => 'has_constraint', ); has original_isa => ( is => 'ro', predicate => 'has_original_isa', ); has trigger_method => ( is => 'ro', predicate => 'has_trigger_method', ); after attach_to_class => sub { my ($self, $class) = @_; return unless $self->has_anon_builder && !$self->anon_builder_installed; ### install our anon builder as a method: $class->name # $class->add_method($self->builder => $self->anon_builder); $class->add_method($self->builder => $self->_builder_method_meta($class)); $self->_set_anon_builder_installed; return; }; before _process_options => sub { shift->_mxas_process_options(@_) }; # this feels... bad. But I'm not sure there's any way to ensure we # process options on a clone/extends without wrapping new(). around new => sub { my ($orig, $self) = (shift, shift); my ($name, %options) = @_; $self->_mxas_process_options($name, \%options) if $options{__hack_no_process_options}; return $self->$orig($name, %options); }; # NOTE: remove_delegation() will also automagically remove any custom # accessors we create here # handle: handles => { name => sub { ... }, ... } around _make_delegation_method => sub { my ($orig, $self) = (shift, shift); my ($name, $coderef) = @_; ### _make_delegation_method() called with a: ref $coderef return $self->$orig(@_) unless 'CODE' eq ref $coderef; # this coderef will be installed as a method on the associated class itself. my $custom_coderef = sub { # aka $self from the class instance's perspective my $associated_class_instance = shift @_; # in $coderef, $_ will be the attribute metaclass local $_ = $self; return $associated_class_instance->$coderef(@_); }; return $self->_process_accessors(custom => { $name => $custom_coderef }); }; sub _mxas_process_options { my ($class, $name, $options) = @_; my $_has = sub { defined $options->{$_[0]} }; my $_opt = sub { $_has->(@_) ? $options->{$_[0]} : q{} }; my $_ref = sub { ref $_opt->(@_) || q{} }; # handle: is => ... $class->_mxas_is_rwp($name, $options, $_has, $_opt, $_ref); $class->_mxas_is_lazy($name, $options, $_has, $_opt, $_ref); # handle: init_arg => 1/-1 $class->_mxas_init_arg($name, $options, $_has, $_opt, $_ref); # handle: builder => 1, builder => sub { ... } $class->_mxas_builder($name, $options, $_has, $_opt, $_ref); # handle: isa_instance_of => ... $class->_mxas_isa_instance_of($name, $options, $_has, $_opt, $_ref); # handle: isa => sub { ... } $class->_mxas_isa_mooish($name, $options, $_has, $_opt, $_ref); # handle: constraint => ... $class->_mxas_constraint($name, $options, $_has, $_opt, $_ref); # handle: coerce => [ ... ] $class->_mxas_coerce($name, $options, $_has, $_opt, $_ref); my %prefix = ( predicate => 'has', clearer => 'clear', trigger => '_trigger_', ); my $is_private = sub { $name =~ /^_/ ? $_[0] : $_[1] }; my $default_for = sub { my ($opt) = @_; return unless $_has->($opt); my $opt_val = $_opt->($opt); my ($head, $mid) = $opt_val eq '1' ? ($is_private->('_', q{}), $is_private->(q{}, '_')) : $opt_val eq '-1' ? ($is_private->(q{}, '_'), $is_private->(q{}, '_')) : return; $options->{$opt} = $head . $prefix{$opt} . $mid . $name; return; }; ### set our other defaults, if requested... $default_for->($_) for qw{ predicate clearer }; my $trigger = "$prefix{trigger}$name"; do { $options->{trigger} = sub { shift->$trigger(@_) }; $options->{trigger_method} = $trigger } if $options->{trigger} && $options->{trigger} eq '1'; return; } # The following two methods are here both to help ensure compatibility with # MooseX::SemiAffordanceAccessor and to enable other packages to modify our # behaviour. sub _mxas_writer_name { my ($class, $name) = @_; return $class->canonical_writer_prefix . $name unless $class->meta->does_role('MooseX::SemiAffordanceAccessor::Role::Attribute'); # ok, if we're here then we need to follow that role's scheme return $name =~ /^_/ ? "_set$name" : "set_$name"; }; sub _mxas_private_writer_name { my ($class, $name) = @_; $name = $class->_mxas_writer_name($name); return $name =~ /^_/ ? $name : "_$name"; } # handle: is => 'rwp' sub _mxas_is_rwp { my ($class, $name, $options, $_has, $_opt, $_ref) = @_; return unless $_opt->('is') eq 'rwp'; $options->{is} = 'ro'; $options->{writer} = $class->_mxas_private_writer_name($name); return; } # handle: init_arg => 1/-1 sub _mxas_init_arg { my ($class, $name, $options, $_has, $_opt, $_ref) = @_; return unless exists $options->{init_arg}; my $one = ($name !~ /^_/) ? $name : $name; my $not_one = ($name !~ /^_/) ? "_$name" : do { (local $_ = $name) =~ s/^_//; $_ }; $options->{init_arg} = ! defined $options->{init_arg} ? return : "$options->{init_arg}" eq 1 ? $one : "$options->{init_arg}" eq -1 ? $not_one : $options->{init_arg} ; return; } # handle: is => 'lazy' sub _mxas_is_lazy { my ($class, $name, $options, $_has, $_opt, $_ref) = @_; return unless $_opt->('is') eq 'lazy'; $options->{is} = 'ro'; $options->{lazy} = 1; $options->{builder} = 1 unless $_has->('builder') || $_has->('default'); return; } # handle: lazy_build => 'private' sub _mxas_lazy_build_private { my ($class, $name, $options, $_has, $_opt, $_ref) = @_; return unless $_opt->('lazy_build') eq 'private'; $options->{lazy_build} = 1; $options->{clearer} = "_clear_$name"; $options->{predicate} = "_has_$name"; return; } # handle: builder => 1, builder => sub { ... } sub _mxas_builder { my ($class, $name, $options, $_has, $_opt, $_ref) = @_; return unless $_has->('builder'); if ($_ref->('builder') eq 'CODE') { $options->{anon_builder} = $options->{builder}; $options->{builder} = 1; } $options->{builder} = $class->_mxas_builder_name($name) if $options->{builder} eq '1'; return; } sub _mxas_isa_mooish { my ($class, $name, $options, $_has, $_opt, $_ref) = @_; return unless $_ref->('isa') eq 'CODE'; ### build a mooish type constraint... $options->{original_isa} = $options->{isa}; $options->{isa} = MooishTC->new(constraint => $options->{isa}); return; } # handle: isa_instance_of => ... sub _mxas_isa_instance_of { my ($class, $name, $options, $_has, $_opt, $_ref) = @_; return unless $_has->('isa_instance_of'); if ($_has->('isa')) { $class->throw_error( q{Cannot use 'isa_instance_of' and 'isa' together for attribute } . $_opt->('definition_context')->{package} . '::' . $name ); } $options->{isa} = class_type(delete $options->{isa_instance_of}); return; } # handle: coerce => [ ... ] sub _mxas_coerce { my ($class, $name, $options, $_has, $_opt, $_ref) = @_; if ($_ref->('coerce') eq 'ARRAY') { ### must be type => sub { ... } pairs... my @coercions = @{ $_opt->('coerce') }; confess 'You must specify an "isa" when declaring "coercion"' unless $_has->('isa'); confess 'coercion array must be in pairs!' if @coercions % 2; confess 'must define at least one coercion pair!' unless @coercions > 0; my $our_coercion = Moose::Meta::TypeCoercion->new; my $our_type = $options->{original_isa} ? $options->{isa} : $_acquire_isa_tc->($_opt->('isa'))->create_child_type ; $our_coercion->add_type_coercions(@coercions); $our_type->coercion($our_coercion); $options->{original_isa} ||= $options->{isa}; $options->{isa} = $our_type; $options->{coerce} = 1; return; } # If our original constraint has coercions and our created subtype # did not have any (as specified in the 'coerce' option), then # copy the parent's coercions over. if ($_has->('original_isa') && $_opt->('coerce') eq '1') { my $isa_type = $_acquire_isa_tc->($_opt->('original_isa')); if ($isa_type->has_coercion) { # create our coercion as a copy of the parent $_opt->('isa')->coercion(Moose::Meta::TypeCoercion->new( type_constraint => $_opt->('isa'), type_coercion_map => [ @{ $isa_type->coercion->type_coercion_map } ], )); } } return; } sub _mxas_constraint { my ($class, $name, $options, $_has, $_opt, $_ref) = @_; return unless $_has->('constraint'); # check for errors... $class->throw_error('You must specify an "isa" when declaring a "constraint"') if !$_has->('isa'); $class->throw_error('"constraint" must be a CODE reference') if $_ref->('constraint') ne 'CODE'; # constraint checking! XXX message, etc? push my @opts, constraint => $_opt->('constraint') if $_ref->('constraint') eq 'CODE'; # stash our original option away and construct our new one my $isa = $options->{original_isa} = $_opt->('isa'); $options->{isa} = $_acquire_isa_tc->($isa)->create_child_type(@opts); return; } sub builder_method_metaclass { my $self = shift @_; return with_traits($self->associated_class->method_metaclass => BuilderTrait); } role { my $p = shift @_; method canonical_writer_prefix => sub { $p->writer_prefix }; method canonical_builder_prefix => sub { $p->builder_prefix }; }; !!42; __END__ =pod =encoding UTF-8 =for :stopwords Chris Weyl Alders David Etheridge Graham Karen Knop Olaf Steinbrunner =head1 NAME MooseX::AttributeShortcuts::Trait::Attribute - Shortcuts attribute trait proper =head1 VERSION This document describes version 0.037 of MooseX::AttributeShortcuts::Trait::Attribute - released November 20, 2017 as part of MooseX-AttributeShortcuts. =head1 DESCRIPTION This is the actual attribute trait that implements L. You should consult that package's documentation for information on any of the new attribute options; we're mainly going to document the additional attributes, methods, and role parameters that this role provides. All methods we include that chain off Moose's C<_process_options()> are prefixed with C<_mxas_> and generally are not documented in the POD; we document any internal methods of L that we wrap or otherwise override we document here as well. =head1 ROLE PARAMETERS Parameterized roles accept parameters that influence their construction. This role accepts the following parameters. =head2 writer_prefix =head2 builder_prefix =head1 ATTRIBUTES =head2 constraint CodeRef, read-only. =head2 original_isa =head2 trigger_method Contains the name of the method that will be invoked as a trigger. =head1 BEFORE METHOD MODIFIERS =head2 _process_options Here we wrap _process_options() instead of the newer _process_is_option(), as that makes our life easier from a Moose 1.x/2.x compatibility perspective -- and that we're generally altering more than just the 'is' option at one time. =head1 AROUND METHOD MODIFIERS =head2 _make_delegation_method Here we create and install any custom accessors that have been defined. =head1 AFTER METHOD MODIFIERS =head2 attach_to_class We hijack attach_to_class in order to install our anon_builder, if we have one. Note that we don't go the normal associate_method/install_accessor/etc route as this is kinda... different. (That is, the builder is not an accessor of this attribute, and should not be installed as such.) =head1 METHODS =head2 has_constraint Predicate for the L attribute. =head2 has_original_isa Predicate for the L attribute. =head2 has_trigger_method Predicate for the L attribute. =head2 builder_method_metaclass() Returns the metaclass we'll use to install a inline builder. =head2 canonical_writer_prefix Returns the writer prefix; this is almost always C. =head2 canonical_builder_prefix Returns the builder prefix; this is almost always C<_build_>. =head1 PREFIXES We accept two parameters on the use of this module; they impact how builders and writers are named. =head2 -writer_prefix use MooseX::::AttributeShortcuts -writer_prefix => 'prefix'; The default writer prefix is C<_set_>. If you'd prefer it to be something else (say, C<_>), this is where you'd do that. =head2 -builder_prefix use MooseX::AttributeShortcuts -builder_prefix => 'prefix'; The default builder prefix is C<_build_>, as this is what L does, and what people in general recognize as build methods. =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =back =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Chris Weyl =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut MooseX-AttributeShortcuts-0.037/lib/MooseX/AttributeShortcuts.pm0000640000175100017510000004346213204655723024707 0ustar maxmindmaxmind# # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package MooseX::AttributeShortcuts; our $AUTHORITY = 'cpan:RSRCHBOY'; # git description: 0.036-2-g03ef7bc $MooseX::AttributeShortcuts::VERSION = '0.037'; # ABSTRACT: Shorthand for common attribute options use strict; use warnings; use namespace::autoclean; use Moose 1.14 (); use Moose::Exporter; use Moose::Meta::TypeConstraint; use Moose::Util::MetaRole; use Moose::Util::TypeConstraints; use MooseX::AttributeShortcuts::Trait::Attribute; use MooseX::AttributeShortcuts::Trait::Role::Attribute; my ($import, $unimport, $init_meta) = Moose::Exporter->build_import_methods( install => [ 'unimport' ], trait_aliases => [ [ 'MooseX::AttributeShortcuts::Trait::Attribute' => 'Shortcuts' ], ], ); my $role_params; sub import { my ($class, %args) = @_; $role_params = {}; do { $role_params->{$_} = delete $args{"-$_"} if exists $args{"-$_"} } for qw{ writer_prefix builder_prefix prefixes }; @_ = ($class, %args); goto &$import; } sub init_meta { my ($class_name, %args) = @_; my $params = delete $args{role_params} || $role_params || undef; undef $role_params; # Just in case we do ever start to get an $init_meta from ME $init_meta->($class_name, %args) if $init_meta; # make sure we have a metaclass instance kicking around my $for_class = $args{for_class}; die "Class $for_class has no metaclass!" unless Class::MOP::class_of($for_class); # If we're given parameters to pass on to construct a role with, we build # it out here rather than pass them on and allowing apply_metaroles() to # handle it, as there are Very Loud Warnings about how parameterized roles # are non-cacheable when generated on the fly. ### $params my $trait = ($params && scalar keys %$params) ? MooseX::AttributeShortcuts::Trait::Attribute ->meta ->generate_role(parameters => $params) : 'MooseX::AttributeShortcuts::Trait::Attribute' ; my $role_attribute_trait = ($params && exists $params->{builder_prefix}) ? MooseX::AttributeShortcuts::Trait::Role::Attribute ->meta ->generate_role( parameters => { builder_prefix => $params->{builder_prefix} }, ) : 'MooseX::AttributeShortcuts::Trait::Role::Attribute' ; Moose::Util::MetaRole::apply_metaroles( # TODO add attribute trait here to create builder method if found for => $for_class, class_metaroles => { attribute => [ $trait ] }, role_metaroles => { applied_attribute => [ $trait ], # attribute => [ 'MooseX::AttributeShortcuts::Trait::Role::Attribute' ], attribute => [ $role_attribute_trait ], }, parameter_metaroles => { applied_attribute => [ $trait ] }, parameterized_role_metaroles => { applied_attribute => [ $trait ] }, ); return Class::MOP::class_of($for_class); } 1; __END__ =pod =encoding UTF-8 =for :stopwords Chris Weyl Alders David Etheridge Graham Karen Knop Olaf Steinbrunner GitHub attribute's isa one's rwp SUBTYPING foo =head1 NAME MooseX::AttributeShortcuts - Shorthand for common attribute options =head1 VERSION This document describes version 0.037 of MooseX::AttributeShortcuts - released November 20, 2017 as part of MooseX-AttributeShortcuts. =head1 SYNOPSIS package Some::Class; use Moose; use MooseX::AttributeShortcuts; # same as: # is => 'ro', lazy => 1, builder => '_build_foo' has foo => (is => 'lazy'); # same as: is => 'ro', writer => '_set_foo' has foo => (is => 'rwp'); # same as: is => 'ro', builder => '_build_bar' has bar => (is => 'ro', builder => 1); # same as: is => 'ro', clearer => 'clear_bar' has bar => (is => 'ro', clearer => 1); # same as: is => 'ro', predicate => 'has_bar' has bar => (is => 'ro', predicate => 1); # works as you'd expect for "private": predicate => '_has_bar' has _bar => (is => 'ro', predicate => 1); # extending? Use the "Shortcuts" trait alias extends 'Some::OtherClass'; has '+bar' => (traits => [Shortcuts], builder => 1, ...); =head1 DESCRIPTION Ever find yourself repeatedly specifying writers and builders, because there's no good shortcut to specifying them? Sometimes you want an attribute to have a read-only public interface, but a private writer. And wouldn't it be easier to just say C<< builder => 1 >> and have the attribute construct the canonical C<_build_$name> builder name for you? This package causes an attribute trait to be applied to all attributes defined to the using class. This trait extends the attribute option processing to handle the above variations. All attribute options as described in L or L remain usable, just as when this trait is not applied. =head2 Some Notes On History Moose has long had a L. It was once considered a best practice, but that has, ah, changed. This trait began as a desire to still leverage bits of C (and a tacit acknowledgment that fat-finger bugs rank among the most embarrassing, right up there with "the TV was unplugged the entire time"). This author does not recommend you use C, unless you know exactly what you're doing (probably) and that it's a good idea (probably not). Nonetheless, this C option is why we set certain options the way we do below; while C in its entirety is not optimal, it had the right idea: regular, predictable accessor names for regular, predictable attribute options. As an example, just looking at the below it doesn't seem logical that: has _foo => (is => 'ro', clearer => 1); ...becomes: has _foo => (is => 'ro', clearer => '_clear_foo'); After reading the L, however, we see that the choice had already been made for us. =for Pod::Coverage init_meta =head1 USAGE This package automatically applies an attribute metaclass trait. Simply using this package causes the trait to be applied by default to your attribute's metaclasses. =head1 EXTENDING A CLASS If you're extending a class and trying to extend its attributes as well, you'll find out that the trait is only applied to attributes defined locally in the class. This package exports a trait shortcut function C that will help you apply this to the extended attribute: has '+something' => (traits => [Shortcuts], ...); =head1 NEW ATTRIBUTE OPTIONS Unless specified here, all options defined by L and L remain unchanged. Want to see additional options? Ask, or better yet, fork on GitHub and send a pull request. If the shortcuts you're asking for already exist in L or L or elsewhere, please note that as it will carry significant weight. For the following, C<$name> should be read as the attribute name; and the various prefixes should be read using the defaults. =head2 is => 'rwp' Specifying C 'rwp'> will cause the following options to be set: is => 'ro' writer => "_set_$name" rwp can be read as "read + write private". =head2 is => 'lazy' Specifying C 'lazy'> will cause the following options to be set: is => 'ro' builder => "_build_$name" lazy => 1 B Since 0.009 we no longer set C undef> if no C is explicitly provided. This is a change made in parallel with L, based on a large number of people surprised that lazy also made one's C undefined. =head2 is => 'lazy', default => ... Specifying C 'lazy'> and a default will cause the following options to be set: is => 'ro' lazy => 1 default => ... # as provided That is, if you specify C 'lazy'> and also provide a C, then we won't try to set a builder, as well. =head2 builder => 1 Specifying C 1> will cause the following options to be set: builder => "_build_$name" =head2 builder => sub { ... } Passing a coderef to builder will cause that coderef to be installed in the class this attribute is associated with the name you'd expect, and C 1> to be set. e.g., in your class (or role), has foo => (is => 'ro', builder => sub { 'bar!' }); ...is effectively the same as... has foo => (is => 'ro', builder => '_build_foo'); sub _build_foo { 'bar!' } The behaviour of this option in roles changed in 0.030, and the builder methods will be installed in the role itself. This means you can alias/exclude/etc builder methods in roles, just as you can with any other method. =head2 clearer => 1 Specifying C 1> will cause the following options to be set: clearer => "clear_$name" or, if your attribute name begins with an underscore: clearer => "_clear$name" (that is, an attribute named C<_foo> would get C<_clear_foo>) =head2 predicate => 1 Specifying C 1> will cause the following options to be set: predicate => "has_$name" or, if your attribute name begins with an underscore: predicate => "_has$name" (that is, an attribute named C<_foo> would get C<_has_foo>) =head2 init_arg => 1 / -1 This is a somewhat esoteric shortcut; you probably don't want to use this (or even read this section). Specifying C 1> will cause the following options to be set: # attribute: "name" init_arg => 'name' # or, attribute: "_name" init_arg => '_name' ...while C -1> will cause the following options to be set: # attribute: "name" init_arg => '_name' # or, attribute: "_name" init_arg => 'name' =head2 trigger => 1 Specifying C 1> will cause the attribute to be created with a trigger that calls a named method in the class with the options passed to the trigger. By default, the method name the trigger calls is the name of the attribute prefixed with C<_trigger_>. e.g., for an attribute named C this would be equivalent to: trigger => sub { shift->_trigger_foo(@_) } For an attribute named C<_foo>: trigger => sub { shift->_trigger__foo(@_) } This naming scheme, in which the trigger is always private, is the same as the builder naming scheme (just with a different prefix). =head2 handles => { foo => sub { ... }, ... } Creating a delegation with a coderef will now create a new, "custom accessor" for the attribute. These coderefs will be installed and called as methods on the associated class (just as readers, writers, and other accessors are), and will have the attribute metaclass available in C<$_>. Anything the accessor is called with it will have access to in C<@_>, just as you'd expect of a method. e.g., the following example creates an attribute named C with a standard reader accessor named C and two custom accessors named C and C. has bar => ( is => 'ro', isa => 'Int', handles => { foo => sub { my $self = shift @_; return $_->get_value($self) + 1; }, foo_too => sub { my $self = shift @_; return $self->bar + 1; }, # ...as you'd expect. bar => 'bar', }, ); ...and later, Note that in this example both foo() and foo_too() do effectively the same thing: return the attribute's current value plus 1. However, foo() accesses the attribute value directly through the metaclass, the pros and cons of which this author leaves as an exercise for the reader to determine. You may choose to use the installed accessors to get at the attribute's value, or use the direct metaclass access, your choice. =head1 ANONYMOUS SUBTYPING AND COERCION "Abusus non tollit usum." Note that we create new, anonymous subtypes whenever the constraint or coercion options are specified in such a way that the Shortcuts trait (this one) is invoked. It's fully supported to use both constraint and coerce options at the same time. This facility is intended to assist with the creation of one-off type constraints and coercions. It is not possible to deliberately reuse the subtypes we create, and if you find yourself using a particular isa / constraint / coerce option triplet in more than one place you should really think about creating a type that you can reuse. L provides the facilities to easily do this, or even a simple L definition at the package level with an anonymous type stashed away for local use. =head2 isa => sub { ... } has foo => ( is => 'rw', # $_ == $_[0] == the value to be validated isa => sub { die unless $_[0] == 1 }, ); # passes constraint $thing->foo(1); # fails constraint $thing->foo(5); Given a coderef, create a type constraint for the attribute. This constraint will fail if the coderef dies, and pass otherwise. Astute users will note that this is the same way L constraints work; we use L to implement the constraint. =head2 isa_instance_of => ... Given a package name, this option will create an C type constraint that requires the value of the attribute be an instance of the class (or a descendant class) given. That is, has foo => (is => 'ro', isa_instance_of => 'SomeThing'); ...is effectively the same as: use Moose::TypeConstraints 'class_type'; has foo => ( is => 'ro', isa => class_type('SomeThing'), ); ...but a touch less awkward. =head2 isa => ..., constraint => sub { ... } Specifying the constraint option with a coderef will cause a new subtype constraint to be created, with the parent type being the type specified in the C option and the constraint being the coderef supplied here. For example, only integers greater than 10 will pass this attribute's type constraint: # value must be an integer greater than 10 to pass the constraint has thinger => ( isa => 'Int', constraint => sub { $_ > 10 }, # ... ); Note that if you supply a constraint, you must also provide an C. =head2 isa => ..., constraint => sub { ... }, coerce => 1 Supplying a constraint and asking for coercion will "Just Work", that is, any coercions that the C type has will still work. For example, let's say that you're using the C type constraint from L, and you want an additional constraint that the file must exist: has thinger => ( is => 'ro', isa => File, constraint => sub { !! $_->stat }, coerce => 1, ); C will correctly coerce the string "/etc/passwd" to a C, and will only accept the coerced result as a value if the file exists. =head2 coerce => [ Type => sub { ...coerce... }, ... ] Specifying the coerce option with a hashref will cause a new subtype to be created and used (just as with the constraint option, above), with the specified coercions added to the list. In the passed hashref, the keys are Moose types (well, strings resolvable to Moose types), and the values are coderefs that will coerce a given type to our type. has bar => ( is => 'ro', isa => 'Str', coerce => [ Int => sub { "$_" }, Object => sub { 'An instance of ' . ref $_ }, ], ); =head1 INTERACTIONS WITH OTHER ATTRIBUTE TRAITS Sometimes attribute traits interact in surprising ways. This trait is well behaved; if you have discovered any interactions with other traits (good, bad, indifferent, etc), please L so that it can be worked around, fixed, or documented, as appropriate. =head2 MooseX::SemiAffordanceAccessor L changes how the C<< is => 'rw' >> and C<< accessor => ... >> attribute options work. If our trait detects that an attribute has had the L applied, then we change our behaviour to conform to its expectations: =over 4 =item * C<< is => 'rwp' >> This: has foo => (is => 'rwp'); has _bar => (is => 'rwp'); ...is now effectively equivalent to: has foo => (is => 'ro', writer => '_set_foo'); has _bar => (is => 'ro', writer => '_set_bar') =item * C<-writer_prefix> is ignored ...as MooseX::SemiAffordanceAccessor has its own specific ideas as to how writers should look. =back =head1 SEE ALSO Please see those modules/websites for more information related to this module. =over 4 =item * L =item * L =item * L =back =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR Chris Weyl =head1 CONTRIBUTORS =for stopwords David Steinbrunner Graham Knop Karen Etheridge Olaf Alders =over 4 =item * David Steinbrunner =item * Graham Knop =item * Karen Etheridge =item * Olaf Alders =back =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut MooseX-AttributeShortcuts-0.037/xt/0000750000175100017510000000000013204655723017130 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/xt/release/0000750000175100017510000000000013204655723020550 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/xt/release/consistent-version.t0000644000175100017510000000032413204655723024615 0ustar maxmindmaxminduse strict; use warnings; use Test::More; eval "use Test::ConsistentVersion"; plan skip_all => "Test::ConsistentVersion required for this test" if $@; Test::ConsistentVersion::check_consistent_versions(); MooseX-AttributeShortcuts-0.037/xt/release/no-smart-comments.t0000644000175100017510000000477613204655723024343 0ustar maxmindmaxmind#!/usr/bin/env perl # # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; use Test::More 0.88; eval "use Test::NoSmartComments"; plan skip_all => 'Test::NoSmartComments required for checking comment IQ' if $@; no_smart_comments_in("lib/MooseX/AttributeShortcuts.pm"); no_smart_comments_in("lib/MooseX/AttributeShortcuts/Trait/Attribute.pm"); no_smart_comments_in("lib/MooseX/AttributeShortcuts/Trait/Attribute/HasAnonBuilder.pm"); no_smart_comments_in("lib/MooseX/AttributeShortcuts/Trait/Method/Builder.pm"); no_smart_comments_in("lib/MooseX/AttributeShortcuts/Trait/Method/HasDefinitionContext.pm"); no_smart_comments_in("lib/MooseX/AttributeShortcuts/Trait/Role/Attribute.pm"); no_smart_comments_in("lib/MooseX/AttributeShortcuts/Trait/Role/Method/Builder.pm"); no_smart_comments_in("t/00-compile.t"); no_smart_comments_in("t/00-report-prereqs.dd"); no_smart_comments_in("t/00-report-prereqs.t"); no_smart_comments_in("t/02-parameterized.t"); no_smart_comments_in("t/03-lazy.t"); no_smart_comments_in("t/05-extend.t"); no_smart_comments_in("t/06-role.t"); no_smart_comments_in("t/builder/basic.t"); no_smart_comments_in("t/builder/inline-builder-conflict-toclass.t"); no_smart_comments_in("t/builder/inline-builder-conflict-torole.t"); no_smart_comments_in("t/builder/inline-definition-context.t"); no_smart_comments_in("t/builder/inline-role-role-class.t"); no_smart_comments_in("t/builder/inline.t"); no_smart_comments_in("t/clearer.t"); no_smart_comments_in("t/constraint.t"); no_smart_comments_in("t/funcs.pm"); no_smart_comments_in("t/handles/coderef-class.t"); no_smart_comments_in("t/handles/coderef.t"); no_smart_comments_in("t/handles/metaclass.t"); no_smart_comments_in("t/init_arg.t"); no_smart_comments_in("t/inline_subtyping/basic.t"); no_smart_comments_in("t/inline_subtyping/coercion.t"); no_smart_comments_in("t/inline_subtyping/with_coercion.t"); no_smart_comments_in("t/is/rwp.t"); no_smart_comments_in("t/isa/mooish.t"); no_smart_comments_in("t/isa_instance_of.t"); no_smart_comments_in("t/metaclasses.t"); no_smart_comments_in("t/old/01-basic.t"); no_smart_comments_in("t/old/04-clearer-and-predicate.t"); no_smart_comments_in("t/old/07-trigger.t"); no_smart_comments_in("t/others/semiaffordanceaccessor.t"); no_smart_comments_in("t/predicate.t"); no_smart_comments_in("t/trigger.t"); done_testing(); MooseX-AttributeShortcuts-0.037/xt/release/minimum-version.t0000644000175100017510000000066613204655723024110 0ustar maxmindmaxmind#!perl # # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.008008} ); MooseX-AttributeShortcuts-0.037/xt/release/has-version.t0000644000175100017510000000063213204655723023201 0ustar maxmindmaxmind#!perl # # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use Test::More; eval "use Test::HasVersion"; plan skip_all => "Test::HasVersion required for testing version numbers" if $@; all_pm_version_ok(); MooseX-AttributeShortcuts-0.037/xt/author/0000750000175100017510000000000013204655723020432 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/xt/author/pod-linkcheck.t0000644000175100017510000000113413204655723023336 0ustar maxmindmaxmind#!perl # # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_LINKCHECK ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::LinkCheck"; if ( $@ ) { plan skip_all => 'Test::Pod::LinkCheck required for testing POD'; } else { Test::Pod::LinkCheck->new->all_pod_ok; } MooseX-AttributeShortcuts-0.037/xt/author/pod-coverage.t0000644000175100017510000000073113204655723023200 0ustar maxmindmaxmind#!perl # # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); MooseX-AttributeShortcuts-0.037/xt/author/pod-syntax.t0000644000175100017510000000064713204655723022741 0ustar maxmindmaxmind#!perl # # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); MooseX-AttributeShortcuts-0.037/xt/author/pod-spell.t0000644000175100017510000000114413204655723022523 0ustar maxmindmaxminduse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007004 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ ABEND AFAICT Alders Attribute AttributeShortcuts Builder Chris David Etheridge Formattable Graham Gratipay HasAnonBuilder HasDefinitionContext Karen Knop Method MooseX Olaf PayPal RSRCHBOY RSRCHBOY's Role Steinbrunner Trait Weyl codebase coderef cweyl dsteinbrunner ether formattable gpg haarg implementers ini lib metaclass metaclasses olaf parameterization parameterized subclasses MooseX-AttributeShortcuts-0.037/xt/author/no-tabs.t0000644000175100017510000000310213204655723022163 0ustar maxmindmaxminduse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/MooseX/AttributeShortcuts.pm', 'lib/MooseX/AttributeShortcuts/Trait/Attribute.pm', 'lib/MooseX/AttributeShortcuts/Trait/Attribute/HasAnonBuilder.pm', 'lib/MooseX/AttributeShortcuts/Trait/Method/Builder.pm', 'lib/MooseX/AttributeShortcuts/Trait/Method/HasDefinitionContext.pm', 'lib/MooseX/AttributeShortcuts/Trait/Role/Attribute.pm', 'lib/MooseX/AttributeShortcuts/Trait/Role/Method/Builder.pm', 't/00-check-deps.t', 't/00-compile.t', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/02-parameterized.t', 't/03-lazy.t', 't/05-extend.t', 't/06-role.t', 't/builder/basic.t', 't/builder/inline-builder-conflict-toclass.t', 't/builder/inline-builder-conflict-torole.t', 't/builder/inline-definition-context.t', 't/builder/inline-role-role-class.t', 't/builder/inline.t', 't/clearer.t', 't/constraint.t', 't/funcs.pm', 't/handles/coderef-class.t', 't/handles/coderef.t', 't/handles/metaclass.t', 't/init_arg.t', 't/inline_subtyping/basic.t', 't/inline_subtyping/coercion.t', 't/inline_subtyping/with_coercion.t', 't/is/rwp.t', 't/isa/mooish.t', 't/isa_instance_of.t', 't/metaclasses.t', 't/old/01-basic.t', 't/old/04-clearer-and-predicate.t', 't/old/07-trigger.t', 't/others/semiaffordanceaccessor.t', 't/predicate.t', 't/trigger.t' ); notabs_ok($_) foreach @files; done_testing; MooseX-AttributeShortcuts-0.037/xt/author/eol.t0000644000175100017510000000313413204655723021404 0ustar maxmindmaxminduse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/MooseX/AttributeShortcuts.pm', 'lib/MooseX/AttributeShortcuts/Trait/Attribute.pm', 'lib/MooseX/AttributeShortcuts/Trait/Attribute/HasAnonBuilder.pm', 'lib/MooseX/AttributeShortcuts/Trait/Method/Builder.pm', 'lib/MooseX/AttributeShortcuts/Trait/Method/HasDefinitionContext.pm', 'lib/MooseX/AttributeShortcuts/Trait/Role/Attribute.pm', 'lib/MooseX/AttributeShortcuts/Trait/Role/Method/Builder.pm', 't/00-check-deps.t', 't/00-compile.t', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/02-parameterized.t', 't/03-lazy.t', 't/05-extend.t', 't/06-role.t', 't/builder/basic.t', 't/builder/inline-builder-conflict-toclass.t', 't/builder/inline-builder-conflict-torole.t', 't/builder/inline-definition-context.t', 't/builder/inline-role-role-class.t', 't/builder/inline.t', 't/clearer.t', 't/constraint.t', 't/funcs.pm', 't/handles/coderef-class.t', 't/handles/coderef.t', 't/handles/metaclass.t', 't/init_arg.t', 't/inline_subtyping/basic.t', 't/inline_subtyping/coercion.t', 't/inline_subtyping/with_coercion.t', 't/is/rwp.t', 't/isa/mooish.t', 't/isa_instance_of.t', 't/metaclasses.t', 't/old/01-basic.t', 't/old/04-clearer-and-predicate.t', 't/old/07-trigger.t', 't/others/semiaffordanceaccessor.t', 't/predicate.t', 't/trigger.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; MooseX-AttributeShortcuts-0.037/.travis.yml0000644000175100017510000000067213204655723020620 0ustar maxmindmaxmind# use the container-based infrastructure sudo: false language: perl perl: - "5.8" - "5.10" - "5.12" - "5.14" - "5.16" - "5.18" - "5.20" - "5.22" - "5.24" - "5.26" matrix: allow_failures: - perl: "5.8" - perl: "5.10" - perl: "5.12" - perl: "5.14" before_install: # git bits sometimes needed... - git config user.name 'Travis-CI' - git config user.email 'travis@nowhere.dne' MooseX-AttributeShortcuts-0.037/Makefile.PL0000644000175100017510000000577613204655723020473 0ustar maxmindmaxmind# # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.010. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Shorthand for common attribute options", "AUTHOR" => "Chris Weyl ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "MooseX-AttributeShortcuts", "LICENSE" => "lgpl", "MIN_PERL_VERSION" => "5.006", "NAME" => "MooseX::AttributeShortcuts", "PREREQ_PM" => { "List::Util" => "1.33", "Moose" => "1.14", "Moose::Exporter" => 0, "Moose::Meta::TypeConstraint" => 0, "Moose::Role" => 0, "Moose::Util::MetaRole" => 0, "Moose::Util::TypeConstraints" => 0, "MooseX::Meta::TypeConstraint::Mooish" => 0, "MooseX::Role::Parameterized" => 0, "MooseX::Types::Common::String" => 0, "MooseX::Types::Moose" => 0, "MooseX::Util" => 0, "aliased" => 0, "namespace::autoclean" => "0.24", "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Moose::Util" => 0, "MooseX::Types::Path::Class" => 0, "Path::Class" => 0, "Test::CheckDeps" => "0.010", "Test::Fatal" => 0, "Test::Moose" => 0, "Test::Moose::More" => "0.049", "Test::More" => "0.94", "Test::Requires" => 0, "constant" => 0, "lib" => 0 }, "VERSION" => "0.037", "test" => { "TESTS" => "t/*.t t/builder/*.t t/handles/*.t t/inline_subtyping/*.t t/is/*.t t/isa/*.t t/old/*.t t/others/*.t" } ); my %FallbackPrereqs = ( "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "List::Util" => "1.33", "Moose" => "1.14", "Moose::Exporter" => 0, "Moose::Meta::TypeConstraint" => 0, "Moose::Role" => 0, "Moose::Util" => 0, "Moose::Util::MetaRole" => 0, "Moose::Util::TypeConstraints" => 0, "MooseX::Meta::TypeConstraint::Mooish" => 0, "MooseX::Role::Parameterized" => 0, "MooseX::Types::Common::String" => 0, "MooseX::Types::Moose" => 0, "MooseX::Types::Path::Class" => 0, "MooseX::Util" => 0, "Path::Class" => 0, "Test::CheckDeps" => "0.010", "Test::Fatal" => 0, "Test::Moose" => 0, "Test::Moose::More" => "0.049", "Test::More" => "0.94", "Test::Requires" => 0, "aliased" => 0, "constant" => 0, "lib" => 0, "namespace::autoclean" => "0.24", "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); MooseX-AttributeShortcuts-0.037/t/0000750000175100017510000000000013204655723016740 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/t/others/0000750000175100017510000000000013204655723020244 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/t/others/semiaffordanceaccessor.t0000640000175100017510000000156313204655723025130 0ustar maxmindmaxminduse strict; use warnings; use Test::More; use Test::Moose::More; use Test::Requires { 'MooseX::SemiAffordanceAccessor' => 0, }; { package AAA; use Moose; use MooseX::AttributeShortcuts; use MooseX::SemiAffordanceAccessor; has rw => (is => 'rw'); has rwp => (is => 'rwp'); has _pvt_rw => (is => 'rw'); has _pvt_rwp => (is => 'rwp'); } validate_class AAA => ( attributes => [ rw => { reader => 'rw', writer => 'set_rw' }, rwp => { reader => 'rwp', writer => '_set_rwp' }, _pvt_rw => { reader => '_pvt_rw', writer => '_set_pvt_rw' }, _pvt_rwp => { reader => '_pvt_rwp', writer => '_set_pvt_rwp' }, ], methods => [ qw{ rw set_rw rwp _set_rwp _pvt_rw _set_pvt_rw _pvt_rwp _set_pvt_rwp } ], ); done_testing; MooseX-AttributeShortcuts-0.037/t/inline_subtyping/0000750000175100017510000000000013204655723022322 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/t/inline_subtyping/with_coercion.t0000640000175100017510000000371713204655723025354 0ustar maxmindmaxminduse strict; use warnings; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; use MooseX::Types::Path::Class ':all'; has bar => ( is => 'rw', isa => File, coerce => 1, constraint => sub { "$_" =~ /foo|baz/ }, ); } use Test::More; use Test::Moose::More 0.018; use Test::Fatal; use Path::Class; use MooseX::Types::Path::Class ':all'; # TODO shift the constraint checking out into TMM? validate_class TestClass => ( attributes => [ bar => { reader => undef, writer => undef, accessor => 'bar', original_isa => File, coerce => 1, required => undef, }, ], ); subtest 'value OK' => sub { my $tc; my $msg = exception { $tc = TestClass->new(bar => 'foo') }; is $msg, undef, 'does not die on construction'; my $bar = $tc->bar; isa_ok $bar, 'Path::Class::File'; is "$bar", 'foo', 'value is correct'; $msg = exception { $tc->bar('baz') }; is $msg, undef, 'does not die on setting'; $bar = $tc->bar; isa_ok $bar, 'Path::Class::File'; is "$bar", 'baz', 'value is correct'; }; subtest 'value NOT OK' => sub { my $error = qr/Attribute \(bar\) does not pass the type constraint/; my $tc; my $msg = exception { $tc = TestClass->new(bar => 'bip') }; ok !!$msg, 'dies on bad value'; like $msg, $error, 'dies with expected message'; $msg = exception { $tc = TestClass->new(bar => file('bip')) }; ok !!$msg, 'dies on bad value'; like $msg, $error, 'dies with expected message'; $tc = TestClass->new; $msg = exception { $tc->bar('bip') }; ok !!$msg, 'dies on bad value'; like $msg, $error, 'dies with expected message'; $msg = exception { $tc->bar(file 'bip') }; ok !!$msg, 'dies on bad value'; like $msg, $error, 'dies with expected message'; }; done_testing; MooseX-AttributeShortcuts-0.037/t/inline_subtyping/coercion.t0000640000175100017510000000411413204655723024311 0ustar maxmindmaxminduse strict; use warnings; { package TestClass::From; use Moose; } my $i = 0; my $sc_trait; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; use Path::Class; use MooseX::Types::Path::Class ':all'; $sc_trait = Shortcuts; has bar => ( is => 'rw', isa => File, coerce => [ 'TestClass::From' => sub { $i++; return file('foo') }, 'Str' => sub { $i++; file $_ }, ], ); } use Test::More; use Test::Moose::More 0.018; use Test::Fatal; use Path::Class; use MooseX::Types::Path::Class ':all'; # TODO shift the constraint checking out into TMM? validate_class TestClass => ( attributes => [ bar => { -does => [ $sc_trait ], reader => undef, writer => undef, accessor => 'bar', isa => File, original_isa => 'MooseX::Types::Path::Class::File', coerce => 1, required => undef, }, ], ); subtest 'Str coercion OK' => sub { my $tc; my $msg = exception { $tc = TestClass->new(bar => 'foo') }; is $msg, undef, 'does not die on construction'; my $bar = $tc->bar; isa_ok $bar, 'Path::Class::File'; is "$bar", 'foo', 'value is correct'; $msg = exception { $tc->bar('baz') }; is $msg, undef, 'does not die on setting'; $bar = $tc->bar; isa_ok $bar, 'Path::Class::File'; is "$bar", 'baz', 'value is correct'; }; subtest 'TestClass::From coercion OK' => sub { my $tc; my $tf = TestClass::From->new(); my $msg = exception { $tc = TestClass->new(bar => $tf) }; is $msg, undef, 'does not die on construction'; my $bar = $tc->bar; isa_ok $bar, 'Path::Class::File'; is "$bar", 'foo', 'value is correct'; $msg = exception { $tc->bar($tf) }; is $msg, undef, 'does not die on setting'; $bar = $tc->bar; isa_ok $bar, 'Path::Class::File'; # yeah, I know, just go with it for now is "$bar", 'foo', 'value is correct'; }; done_testing; MooseX-AttributeShortcuts-0.037/t/inline_subtyping/basic.t0000640000175100017510000000301513204655723023570 0ustar maxmindmaxminduse strict; use warnings; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; has bar => ( is => 'rw', isa => 'Int', constraint => sub { $_ > 0 }, ); } use Test::More; use Test::Moose::More 0.017; use Test::Fatal; # TODO shift the constraint checking out into TMM? validate_class TestClass => ( attributes => [ bar => { reader => undef, writer => undef, accessor => 'bar', original_isa => 'Int', required => undef, }, ], ); subtest 'value OK' => sub { my $tc; my $msg = exception { $tc = TestClass->new(bar => 10) }; is $msg, undef, 'does not die on construction'; is $tc->bar, 10, 'value is correct'; $msg = exception { $tc->bar(20) }; is $msg, undef, 'does not die on setting'; is $tc->bar, 20, 'value is correct'; }; subtest 'value NOT OK' => sub { my $error = qr/Attribute \(bar\) does not pass the type constraint/; my $tc; my $msg = exception { $tc = TestClass->new(bar => -10) }; ok !!$msg, 'dies on bad value'; like $msg, $error, 'dies with expected message'; $msg = exception { $tc = TestClass->new(bar => 10) }; is $msg, undef, 'does not die on construction with OK value'; is $tc->bar, 10, 'value is correct'; $msg = exception { $tc->bar(-10) }; ok !!$msg, 'dies on bad value'; like $msg, $error, 'dies with expected message'; }; done_testing; MooseX-AttributeShortcuts-0.037/t/00-report-prereqs.dd0000644000175100017510000000741313204655723022472 0ustar maxmindmaxminddo { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0', 'perl' => '5.006' } }, 'develop' => { 'requires' => { 'Pod::Coverage::TrustPod' => '0', 'Pod::Wordlist' => '0', 'Test::ConsistentVersion' => '0', 'Test::EOL' => '0', 'Test::HasVersion' => '0', 'Test::MinimumVersion' => '0', 'Test::More' => '0.88', 'Test::NoSmartComments' => '0', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Pod::LinkCheck' => '0', 'Test::Spelling' => '0.12' } }, 'runtime' => { 'requires' => { 'List::Util' => '1.33', 'Moose' => '1.14', 'Moose::Exporter' => '0', 'Moose::Meta::TypeConstraint' => '0', 'Moose::Role' => '0', 'Moose::Util::MetaRole' => '0', 'Moose::Util::TypeConstraints' => '0', 'MooseX::Meta::TypeConstraint::Mooish' => '0', 'MooseX::Role::Parameterized' => '0', 'MooseX::Types::Common::String' => '0', 'MooseX::Types::Moose' => '0', 'MooseX::Util' => '0', 'aliased' => '0', 'namespace::autoclean' => '0.24', 'perl' => '5.006', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Moose::Util' => '0', 'MooseX::Types::Path::Class' => '0', 'Path::Class' => '0', 'Test::CheckDeps' => '0.010', 'Test::Fatal' => '0', 'Test::Moose' => '0', 'Test::Moose::More' => '0.049', 'Test::More' => '0.94', 'Test::Requires' => '0', 'constant' => '0', 'lib' => '0', 'perl' => '5.006' }, 'suggests' => { 'MooseX::SemiAffordanceAccessor' => '0' } } }; $x; }MooseX-AttributeShortcuts-0.037/t/00-report-prereqs.t0000644000175100017510000001402313204655723022341 0ustar maxmindmaxmind#!perl # # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: MooseX-AttributeShortcuts-0.037/t/02-parameterized.t0000640000175100017510000000150413204655723022201 0ustar maxmindmaxminduse strict; use warnings; { package TestClass::WriterPrefix; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts -writer_prefix => '_'; has foo => (is => 'rwp'); has bar => (is => 'ro', builder => 1); has baz => (is => 'rwp', builder => 1); } { package TestClass::BuilderPrefix; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts -builder_prefix => '_silly_'; has foo => (is => 'rwp'); has bar => (is => 'ro', builder => 1); has baz => (is => 'rwp', builder => 1); } use Test::More; use Test::Moose; use lib 't'; require funcs; with_immutable { test_class('TestClass::WriterPrefix', '_') } 'TestClass::WriterPrefix'; with_immutable { test_class('TestClass::BuilderPrefix', undef, '_silly_') } 'TestClass::BuilderPrefix'; done_testing; MooseX-AttributeShortcuts-0.037/t/isa_instance_of.t0000640000175100017510000000130613204655723022252 0ustar maxmindmaxminduse strict; use warnings; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; has bar => (is => 'ro', isa_instance_of => 'SomeClass'); } use Test::More; use Test::Moose::More; # TODO shift the constraint checking out into TMM? validate_class TestClass => ( attributes => [ qw{ bar } ], ); subtest 'isa_instance_of check' => sub { my $att = 'bar'; my $meta = TestClass->meta->get_attribute($att); ok $meta->has_type_constraint, "$att has a type constraint"; my $tc = $meta->type_constraint; isa_ok $tc, 'Moose::Meta::TypeConstraint::Class'; is $tc->class, 'SomeClass', 'tc looks for correct class'; }; done_testing; MooseX-AttributeShortcuts-0.037/t/handles/0000750000175100017510000000000013204655723020356 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/t/handles/coderef-class.t0000640000175100017510000000170613204655723023262 0ustar maxmindmaxminduse strict; use warnings; use Test::More; use Test::Moose::More; my $called = 0; { package Y; use Moose; sub whee { } } { package Z; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; has foo => ( is => 'ro', isa => 'Y', handles => { our_accessor => sub { my $self = shift @_; Test::More::pass 'in our_accessor()'; Test::More::isa_ok $_, 'Moose::Meta::Attribute'; Test::More::isa_ok $self, 'Z'; $called++; return 6; }, whee => 'whee', }, ); } validate_class Z => ( attributes => [ qw{ foo } ], methods => [ qw{ foo our_accessor whee } ], ); my $tc = Z->new(foo => Y->new()); isa_ok($tc, 'Z'); isa_ok $tc->foo => 'Y'; is $tc->our_accessor, 6, 'our_accessor() is 6'; ok $called => 'custom accessor called'; done_testing; MooseX-AttributeShortcuts-0.037/t/handles/metaclass.t0000640000175100017510000000050013204655723022513 0ustar maxmindmaxminduse strict; use warnings; use Test::More; use Test::Fatal; use MooseX::AttributeShortcuts (); { package TestClass; } my $dies = exception { MooseX::AttributeShortcuts->init_meta(for_class => 'foo') }; like $dies, qr/Class foo has no metaclass!/, 'init_meta() dies on no-metaclass', ; done_testing; MooseX-AttributeShortcuts-0.037/t/handles/coderef.t0000640000175100017510000000143613204655723022157 0ustar maxmindmaxminduse strict; use warnings; use Test::More; use Test::Moose::More; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; has foo => ( is => 'ro', isa => 'Int', handles => { our_accessor => sub { my $self = shift @_; Test::More::pass 'in our_accessor()'; Test::More::isa_ok $_, 'Moose::Meta::Attribute'; return $_->get_value($self) + 2; }, }, ); } validate_class TestClass => ( attributes => [ qw{ foo } ], methods => [ qw{ foo our_accessor } ], ); my $tc = TestClass->new(foo => 4); isa_ok($tc, 'TestClass'); is $tc->foo, 4, 'foo() is 4'; is $tc->our_accessor, 6, 'our_accessor() is 6'; done_testing; MooseX-AttributeShortcuts-0.037/t/00-check-deps.t0000644000175100017510000000043613204655723021360 0ustar maxmindmaxminduse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CheckDeps 0.014 use Test::More 0.94; use Test::CheckDeps 0.010; check_dependencies('suggests'); if (1) { BAIL_OUT("Missing dependencies") if !Test::More->builder->is_passing; } done_testing; MooseX-AttributeShortcuts-0.037/t/builder/0000750000175100017510000000000013204655723020366 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/t/builder/inline-builder-conflict-toclass.t0000640000175100017510000000356513204655723026734 0ustar maxmindmaxminduse strict; use warnings; use constant ATTRIBUTE_TRAIT => 'MooseX::AttributeShortcuts::Trait::Attribute'; use constant ROLE_ATTRIBUTE_TRAIT => 'MooseX::AttributeShortcuts::Trait::Role::Attribute'; # Here we test how anonymous builders in roles work. Until recently, the # corresponding builder method was only created when a role was applied to a # class, so the usual logic of excluding, etc, failed. # # Was this a problem in practice? I never ran into it, and I haven't seen any # bug reports about it, so... probably not? use Moose::Util 'find_meta'; use Test::More; use Test::Moose::More 0.047; { package TestRole::A; use Moose::Role; use MooseX::AttributeShortcuts; has bar => (is => 'ro', builder => sub { 2 }); } { package TestRole::B; use Moose::Role; sub _build_bar { 4 } } { package TestClass; use Moose; with 'TestRole::A', 'TestRole::B'; sub _build_bar { 16 } } validate_role 'TestRole::A' => ( -subtest => 'TestRole::A', methods => [ qw{ _build_bar } ], role_metaroles => { attribute => [ ROLE_ATTRIBUTE_TRAIT ], applied_attribute => [ ATTRIBUTE_TRAIT ], }, attributes => [ bar => { -does => [ ROLE_ATTRIBUTE_TRAIT ], }, ], ); validate_role 'TestRole::B' => ( -subtest => 'TestRole::B', methods => [ qw{ _build_bar } ], ); validate_class TestClass => ( -subtest => 'TestClass', does => ['TestRole::A', 'TestRole::B'], methods => ['_build_bar'], attributes => [ bar => { -does => [ATTRIBUTE_TRAIT], builder => '_build_bar', }, ], ); is TestClass::_build_bar() => 16, '...::_build_bar() is correct (16)'; my $tc = TestClass->new; is $tc->bar() => 16, 'builder method as expected (16)'; method_from_pkg_ok TestClass => '_build_bar', 'TestClass'; done_testing; MooseX-AttributeShortcuts-0.037/t/builder/inline-builder-conflict-torole.t0000640000175100017510000000340413204655723026560 0ustar maxmindmaxminduse strict; use warnings; use constant ATTRIBUTE_TRAIT => 'MooseX::AttributeShortcuts::Trait::Attribute'; use constant ROLE_ATTRIBUTE_TRAIT => 'MooseX::AttributeShortcuts::Trait::Role::Attribute'; use Moose::Util 'find_meta'; use Test::More; use Test::Moose::More 0.047; { package TestRole::A; use Moose::Role; use MooseX::AttributeShortcuts; has bar => (is => 'ro', builder => sub { 2 }); } { package TestRole::B; use Moose::Role; sub _build_bar { 4 } } { package TestRole::Combined; use Moose::Role; with 'TestRole::A', 'TestRole::B'; sub _build_bar { 16 } } { package TestClass; use Moose; with 'TestRole::Combined'; } validate_role 'TestRole::A' => ( -subtest => 1, methods => [ qw{ _build_bar } ], role_metaroles => { attribute => [ ROLE_ATTRIBUTE_TRAIT ], applied_attribute => [ ATTRIBUTE_TRAIT ], }, attributes => [ bar => { -does => [ ROLE_ATTRIBUTE_TRAIT ], }, ], ); validate_role 'TestRole::B' => ( -subtest => 1, methods => [ qw{ _build_bar } ], ); validate_role 'TestRole::Combined' => ( -subtest => 1, does => ['TestRole::A', 'TestRole::B'], attributes => ['bar'], methods => [ qw{ _build_bar } ], ); validate_class TestClass => ( -subtest => 1, does => ['TestRole::Combined'], methods => ['_build_bar'], attributes => [ bar => { -does => [ATTRIBUTE_TRAIT], builder => '_build_bar', }, ], ); is TestClass::_build_bar() => 16, '...::_build_bar() is correct (16)'; my $tc = TestClass->new; is $tc->bar() => 16, 'builder method as expected (16)'; method_from_pkg_ok TestClass => '_build_bar', 'TestRole::Combined'; done_testing; MooseX-AttributeShortcuts-0.037/t/builder/inline-definition-context.t0000640000175100017510000000301613204655723025642 0ustar maxmindmaxminduse strict; use warnings; use Test::More; use Test::Moose::More 0.049 ':all'; use aliased 'MooseX::AttributeShortcuts::Trait::Method::Builder' => 'BuilderTrait'; use aliased 'MooseX::AttributeShortcuts::Trait::Role::Method::Builder' => 'RoleBuilderTrait'; { package BBB; use Moose::Role; use MooseX::AttributeShortcuts; has bar => (is => 'lazy', builder => sub { }); } { package AAA; use Moose; use MooseX::AttributeShortcuts; with 'BBB'; has foo => (is => 'lazy', builder => sub { }); } my %data = ( _build_foo => [ { context => 'has declaration', description => 'builder AAA::_build_foo of attribute foo', file => __FILE__, line => 25, package => 'AAA', type => 'class', }, BuilderTrait, ], _build_bar => [ { context => 'has declaration', description => 'builder BBB::_build_bar of attribute bar', file => __FILE__, line => 17, package => 'BBB', type => 'role' }, RoleBuilderTrait, ], ); # until TMM properly allows method metaclass testing via the validate_*()'s, # we'll do it the hard way _method($_ => @{$data{$_}}) for sort keys %data; sub _method { my ($name, $dc, $trait) = @_; my $method = AAA->meta->get_method($name); does_ok $method, $trait; definition_context_ok($method, $dc); } done_testing; MooseX-AttributeShortcuts-0.037/t/builder/inline-role-role-class.t0000640000175100017510000000262513204655723025040 0ustar maxmindmaxminduse strict; use warnings; use Test::More; use Test::Moose::More; use constant ATTRIBUTE_TRAIT => 'MooseX::AttributeShortcuts::Trait::Attribute'; use constant ROLE_ATTRIBUTE_TRAIT => 'MooseX::AttributeShortcuts::Trait::Role::Attribute'; { package A; use Moose::Role; use MooseX::AttributeShortcuts; has a => (is => 'ro', builder => sub { 16 }) } { package B; use Moose::Role; with 'A' } { package C; use Moose; with 'B' } validate_role 'A' => ( -subtest => 'A', methods => [ qw{ _build_a } ], role_metaroles => { attribute => [ ROLE_ATTRIBUTE_TRAIT ], applied_attribute => [ ATTRIBUTE_TRAIT ], }, attributes => [ a => { -does => [ ROLE_ATTRIBUTE_TRAIT ], }, ], ); validate_role 'B' => ( -subtest => 'B', does => ['A'], methods => [ qw{ _build_a } ], ); validate_class 'C' => ( -subtest => 'C', does => ['A', 'B'], attributes => ['bar'], methods => [ qw{ _build_bar } ], methods => ['_build_a'], attributes => [ a => { -does => [ATTRIBUTE_TRAIT], builder => '_build_a', }, ], ); is C::_build_a() => 16, '...::_build_bar() is correct (16)'; my $tc = C->new; is $tc->a() => 16, 'builder method as expected (16)'; method_from_pkg_ok C => '_build_a', 'A'; done_testing; MooseX-AttributeShortcuts-0.037/t/builder/inline.t0000640000175100017510000000451613204655723022040 0ustar maxmindmaxminduse strict; use warnings; # These tests only concern themselves with the 'builder => sub { ... }' # functionality, as 'builder => 1' is tested elsewhere. use Test::More; use Test::Moose::More 0.044; use constant ATTRIBUTE_TRAIT => 'MooseX::AttributeShortcuts::Trait::Attribute'; use constant ROLE_ATTRIBUTE_TRAIT => 'MooseX::AttributeShortcuts::Trait::Role::Attribute'; my $i = 0; { package TestRole; use Moose::Role; use namespace::autoclean; use MooseX::AttributeShortcuts; has bar => (is => 'ro', builder => sub { $i++ }); has _bar => (is => 'ro', builder => sub { $i++ }); } { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; # HA! with 'TestRole'; has foo => (is => 'ro', builder => sub { $i++ }); has _foo => (is => 'ro', builder => sub { $i++ }); } validate_class TestClass => ( -subtest => 'validate TestClass structure', does => [ 'TestRole' ], attributes => [ qw{ foo _foo }, bar => { -does => [ ATTRIBUTE_TRAIT ], builder => '_build_bar', }, _bar => { -does => [ ATTRIBUTE_TRAIT ], builder => '_build__bar', }, foo => { -does => [ ATTRIBUTE_TRAIT ], builder => '_build_foo', }, _foo => { -does => [ ATTRIBUTE_TRAIT ], builder => '_build__foo', }, ], methods => [ qw{ foo _build_foo _foo _build__foo bar _build_bar _bar _build__bar } ], ); subtest 'check counters!' => sub { is $i, 0, 'counter correct (sanity check)'; my $tc = TestClass->new; isa_ok $tc, 'TestClass'; is $i, 4, 'counter correct'; }; # using builders in roles and being able to exclude/alias them as # necessary when consuming them is a major win. Because of that -- and # because that's what we'd expect to be able to do with a builder when # created in the usual fashion (aka not anon sub via us) we want to create # the builder as a method in the role when we define the attribute to a # role. validate_role TestRole => ( -subtest => 'TestRole', attributes => [ bar => { -does => [ ATTRIBUTE_TRAIT ] }, _bar => { -does => [ ATTRIBUTE_TRAIT ] }, ], methods => [ qw{ _build_bar _build__bar } ], ); done_testing; MooseX-AttributeShortcuts-0.037/t/builder/basic.t0000640000175100017510000000244613204655723021643 0ustar maxmindmaxminduse strict; use warnings; use Test::More; use Test::Moose::More 0.043; use constant Shortcuts => 'MooseX::AttributeShortcuts::Trait::Attribute'; { package TestClass; use Moose; use namespace::autoclean 0.24; use MooseX::AttributeShortcuts; has public => (is => 'rw', lazy => 1, builder => 1); has _private => (is => 'rw', lazy => 1, builder => 1); } validate_class TestClass => ( methods => [qw{ public _private }], no_methods => [ qw{ _build_public _build__private build_public build__private } ], attributes => [ public => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => '_build_public', default => undef, predicate => undef, accessor => 'public', }, _private => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => '_build__private', default => undef, predicate => undef, accessor => '_private', }, ], ); done_testing; MooseX-AttributeShortcuts-0.037/t/old/0000750000175100017510000000000013204655723017516 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/t/old/04-clearer-and-predicate.t0000640000175100017510000000210013204655723024231 0ustar maxmindmaxminduse strict; use warnings; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; has foo => (is => 'rw', clearer => 1, predicate => -1); has _foo => (is => 'rw', clearer => 1, predicate => -1); has bar => (is => 'rw', predicate => 1, clearer => -1); has _bar => (is => 'rw', predicate => 1, clearer => -1); } use Test::More; use Test::Moose; use Test::Moose::More 0.043; validate_class TestClass => ( methods => [qw{ foo clear_foo _has_foo _foo _clear_foo has_foo bar has_bar _clear_bar _bar _has_bar clear_bar }], attributes => [ foo => { accessor => 'foo', clearer => 'clear_foo', predicate => '_has_foo' }, _foo => { accessor => '_foo', clearer => '_clear_foo', predicate => 'has_foo' }, bar => { accessor => 'bar', predicate => 'has_bar', clearer => '_clear_bar' }, _bar => { accessor => '_bar', predicate => '_has_bar', clearer => 'clear_bar' }, ], ); done_testing; MooseX-AttributeShortcuts-0.037/t/old/07-trigger.t0000640000175100017510000000205213204655723021572 0ustar maxmindmaxminduse strict; use warnings; my $trigger_called = 0; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; has foo => (is => 'rwp'); has bar => (is => 'ro', builder => 1); has baz => (is => 'rwp', builder => 1); sub _build_bar {} sub _build_baz {} has fee => (is => 'rw', trigger => 1); sub _trigger_fee { $trigger_called++ } has _foe => (is => 'rw', trigger => 1); sub _trigger__foe { $trigger_called++ } } use Test::More; use Test::Moose; use lib 't'; require funcs; with_immutable { test_class('TestClass'); for my $name (qw{ fee _foe }) { $trigger_called = 0; my $a = TestClass->meta->get_attribute($name); ok $a->has_trigger, "$name has a trigger"; ok !$trigger_called, 'no trigger calls yet'; my $tc = TestClass->new($name => 'Ian'); is $trigger_called, 1, 'trigger called once'; $tc->$name('Cormac'); is $trigger_called, 2, 'trigger called again'; } } 'TestClass'; done_testing; MooseX-AttributeShortcuts-0.037/t/old/01-basic.t0000640000175100017510000000054713204655723021211 0ustar maxmindmaxminduse strict; use warnings; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; has foo => (is => 'rwp'); has bar => (is => 'ro', builder => 1); has baz => (is => 'rwp', builder => 1); } use Test::More; use Test::Moose; use lib 't'; require funcs; test_class('TestClass'); done_testing; MooseX-AttributeShortcuts-0.037/t/metaclasses.t0000640000175100017510000000166413204655723021441 0ustar maxmindmaxminduse strict; use warnings; use Test::More; # Simple checks to ensure our traits are applied where we expect them to be. use Test::Moose::More 0.044; { package TestClass; use Moose; use MooseX::AttributeShortcuts; has foo => (is => 'ro') } { package TestRole; use Moose::Role; use MooseX::AttributeShortcuts; has foo => (is => 'ro') } validate_class TestClass => ( -subtest => 'validate_class TestClass', class_metaroles => { attribute => ['MooseX::AttributeShortcuts::Trait::Attribute'], }, attributes => [ foo => { -does => ['MooseX::AttributeShortcuts::Trait::Attribute'] }, ], ); validate_role TestRole => ( -subtest => 'validate_Role TestRole', role_metaroles => { applied_attribute => ['MooseX::AttributeShortcuts::Trait::Attribute'], }, attributes => [ foo => { -does => ['MooseX::AttributeShortcuts::Trait::Attribute'] }, ], ); done_testing; __END__ MooseX-AttributeShortcuts-0.037/t/00-compile.t0000644000175100017510000000342713204655723021005 0ustar maxmindmaxminduse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.057 use Test::More; plan tests => 7 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'MooseX/AttributeShortcuts.pm', 'MooseX/AttributeShortcuts/Trait/Attribute.pm', 'MooseX/AttributeShortcuts/Trait/Attribute/HasAnonBuilder.pm', 'MooseX/AttributeShortcuts/Trait/Method/Builder.pm', 'MooseX/AttributeShortcuts/Trait/Method/HasDefinitionContext.pm', 'MooseX/AttributeShortcuts/Trait/Role/Attribute.pm', 'MooseX/AttributeShortcuts/Trait/Role/Method/Builder.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; MooseX-AttributeShortcuts-0.037/t/isa/0000750000175100017510000000000013204655723017514 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/t/isa/mooish.t0000640000175100017510000000273113204655723021203 0ustar maxmindmaxminduse strict; use warnings; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; has bar => ( is => 'rw', isa => sub { die unless $_[0] == 5 || $_[0] == 10 }, ); } use Test::More; use Test::Moose::More 0.017; use Test::Fatal; # TODO shift the constraint checking out into TMM? validate_class TestClass => ( attributes => [ bar => { reader => undef, writer => undef, accessor => 'bar', required => undef, }, ], ); subtest 'value OK' => sub { my $tc; my $msg = exception { $tc = TestClass->new(bar => 5) }; is $msg, undef, 'does not die on construction'; is $tc->bar, 5, 'value is correct'; $msg = exception { $tc->bar(10) }; is $msg, undef, 'does not die on setting'; is $tc->bar, 10, 'value is correct'; }; subtest 'value NOT OK' => sub { my $error = qr/Attribute \(bar\) does not pass the type constraint/; my $tc; my $msg = exception { $tc = TestClass->new(bar => -10) }; ok !!$msg, 'dies on bad value'; like $msg, $error, 'dies with expected message'; $msg = exception { $tc = TestClass->new(bar => 5) }; is $msg, undef, 'does not die on construction with OK value'; is $tc->bar, 5, 'value is correct'; $msg = exception { $tc->bar(-10) }; ok !!$msg, 'dies on bad value'; like $msg, $error, 'dies with expected message'; }; done_testing; MooseX-AttributeShortcuts-0.037/t/constraint.t0000640000175100017510000000204513204655723021313 0ustar maxmindmaxminduse strict; use warnings; # test our new constraint option # # this test is perhaps a bit redundnant, given t/inline_*.t, but it's kinda # where I'd like to see it go when Test::Moose::More is retrofitted with # isa/type_constraint checking support. use Test::More; use Test::Moose::More; use Moose::Util; use Moose::Util::TypeConstraints; my $shortcuts; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; $shortcuts = Shortcuts; has foo => ( is => 'rw', isa => 'Str', constraint => sub { /^Hi/ }, ); } my $tc = Moose::Util::TypeConstraints::find_or_create_isa_type_constraint('Str') ->create_child_type(constraint => sub { /^Hi/ }) ; validate_class TestClass => ( attributes => [ foo => { -does => [ $shortcuts ], accessor => 'foo', original_isa => 'Str', type_constraint => $tc, isa => $tc, }, ], ); done_testing; MooseX-AttributeShortcuts-0.037/t/predicate.t0000640000175100017510000000467413204655723021101 0ustar maxmindmaxmind use strict; use warnings; use Test::More; use Test::Moose::More 0.043; use constant Shortcuts => 'MooseX::AttributeShortcuts::Trait::Attribute'; { package TestClass; use Moose; use namespace::autoclean 0.24; use MooseX::AttributeShortcuts; # four permutations here: public/normal, private/normal, public/inverse, # private/inverse has public => (is => 'rw', predicate => 1); has _private => (is => 'rw', predicate => 1); has public_inverse => (is => 'rw', predicate => -1); has _private_inverse => (is => 'rw', predicate => -1); } validate_class TestClass => ( methods => [qw{ public has_public _private _has_private public_inverse _has_public_inverse _private_inverse has_private_inverse }], attributes => [ public => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => 'public', predicate => 'has_public', }, _private => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => '_private', predicate => '_has_private', }, public_inverse => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => 'public_inverse', predicate => '_has_public_inverse', }, _private_inverse => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => '_private_inverse', predicate => 'has_private_inverse', }, ], ); done_testing; MooseX-AttributeShortcuts-0.037/t/05-extend.t0000640000175100017510000000105413204655723020637 0ustar maxmindmaxminduse strict; use warnings; { package TestClass; use Moose; use namespace::autoclean; has bar => (is => 'ro'); } { package TestClassTwo; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; extends 'TestClass'; has '+bar' => (traits => [Shortcuts], builder => 1); has foo => (is => 'rwp'); has baz => (is => 'rwp', builder => 1); } use Test::More; use Test::Moose; use lib 't'; require funcs; with_immutable { test_class('TestClassTwo') } 'TestClass', 'TestClassTwo'; done_testing; MooseX-AttributeShortcuts-0.037/t/init_arg.t0000640000175100017510000000452413204655723020727 0ustar maxmindmaxmind use strict; use warnings; use Test::More; use Test::Moose::More 0.043; use constant Shortcuts => 'MooseX::AttributeShortcuts::Trait::Attribute'; { package TestClass; use Moose; use namespace::autoclean 0.24; use MooseX::AttributeShortcuts; # four permutations here: public/normal, private/normal, public/inverse, # private/inverse has public => (is => 'rw', init_arg => 1); has _private => (is => 'rw', init_arg => 1); has public_inverse => (is => 'rw', init_arg => -1); has _private_inverse => (is => 'rw', init_arg => -1); } validate_class TestClass => ( methods => [qw{ public _private public_inverse _private_inverse }], attributes => [ public => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => 'public', init_arg => 'public', }, _private => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => '_private', init_arg => '_private', }, public_inverse => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => 'public_inverse', init_arg => '_public_inverse', }, _private_inverse => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => '_private_inverse', init_arg => 'private_inverse', }, ], ); done_testing; MooseX-AttributeShortcuts-0.037/t/trigger.t0000640000175100017510000000371113204655723020573 0ustar maxmindmaxmind use strict; use warnings; use Test::More; use Test::Moose::More 0.043; use constant Shortcuts => 'MooseX::AttributeShortcuts::Trait::Attribute'; my $trigger_called = 0; { package TestClass; use Moose; use namespace::autoclean 0.24; use MooseX::AttributeShortcuts; # "trigger => -1" isn't supported (feel free to submit a PR) has public => (is => 'rw', trigger => 1); has _private => (is => 'rw', trigger => 1); has test => (is => 'rw', trigger => 1); sub _trigger_test { $trigger_called++ } } validate_class TestClass => ( -subtest => 'validating class TestClass', methods => [qw{ public _private }], no_methods => [ qw{ _trigger_public _trigger__private } ], attributes => [ public => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => 'public', trigger_method => '_trigger_public', }, _private => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => '_private', trigger_method => '_trigger__private', }, ], ); subtest 'make sure the trigger is called' => sub { my $name = 'test'; my $a = TestClass->meta->get_attribute($name); ok $a->has_trigger, "$name has a trigger"; ok !$trigger_called, 'no trigger calls yet'; my $tc = TestClass->new($name => 'Ian'); is $trigger_called, 1, 'trigger called once'; $tc->$name('Cormac'); is $trigger_called, 2, 'trigger called again'; }; done_testing; MooseX-AttributeShortcuts-0.037/t/clearer.t0000640000175100017510000000470413204655723020550 0ustar maxmindmaxmind use strict; use warnings; use Test::More; use Test::Moose::More 0.043; use constant Shortcuts => 'MooseX::AttributeShortcuts::Trait::Attribute'; { package TestClass; use Moose; use namespace::autoclean 0.24; use MooseX::AttributeShortcuts; # four permutations here: public/normal, private/normal, public/inverse, # private/inverse has public => (is => 'rw', clearer => 1); has _private => (is => 'rw', clearer => 1); has public_inverse => (is => 'rw', clearer => -1); has _private_inverse => (is => 'rw', clearer => -1); } validate_class TestClass => ( methods => [qw{ public clear_public _private _clear_private public_inverse _clear_public_inverse _private_inverse clear_private_inverse }], attributes => [ public => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => 'public', clearer => 'clear_public', }, _private => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => '_private', clearer => '_clear_private', }, public_inverse => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => 'public_inverse', clearer => '_clear_public_inverse', }, _private_inverse => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => undef, writer => undef, clearer => undef, builder => undef, default => undef, predicate => undef, accessor => '_private_inverse', clearer => 'clear_private_inverse', }, ], ); done_testing; MooseX-AttributeShortcuts-0.037/t/06-role.t0000640000175100017510000000103613204655723020312 0ustar maxmindmaxminduse strict; use warnings; { package TestRole; use Moose::Role; use namespace::autoclean; use MooseX::AttributeShortcuts; has foo => (is => 'rwp'); has bar => (is => 'ro', builder => 1); } { package TestClassTwo; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; with 'TestRole'; has baz => (is => 'rwp', builder => 1); } use Test::More; use Test::Moose; use lib 't'; require funcs; with_immutable { test_class('TestClassTwo'); } 'TestClassTwo'; done_testing; MooseX-AttributeShortcuts-0.037/t/03-lazy.t0000640000175100017510000000175213204655723020332 0ustar maxmindmaxminduse strict; use warnings; { package TestClass; use Moose; use namespace::autoclean; use MooseX::AttributeShortcuts; has foo => (is => 'lazy'); has bar => (is => 'lazy', default => 'bip!'); # if this one fails, we're just going to get a die() off it for a "cannot # have both a builder and a default!" violation. So, the test here really # is "does it not die?" has baz => (is => 'lazy', default => 0); } use Test::More; use Test::Moose; use lib 't'; require funcs; my %foo_accessors = ( reader => 'foo', init_arg => 'foo', lazy => 1, builder => '_build_foo', default => undef, ); my %bar_accessors = ( reader => 'bar', init_arg => 'bar', lazy => 1, default => 'bip!', builder => undef, ); with_immutable { test_class_sanity_checks('TestClass'); check_attribute('TestClass', foo => %foo_accessors); check_attribute('TestClass', bar => %bar_accessors); } 'TestClass'; done_testing; MooseX-AttributeShortcuts-0.037/t/is/0000750000175100017510000000000013204655723017353 5ustar maxmindmaxmindMooseX-AttributeShortcuts-0.037/t/is/rwp.t0000640000175100017510000000223113204655723020347 0ustar maxmindmaxmind use strict; use warnings; use Test::More; use Test::Moose::More 0.043; use constant Shortcuts => 'MooseX::AttributeShortcuts::Trait::Attribute'; { package TestClass; use Moose; use namespace::autoclean 0.24; use MooseX::AttributeShortcuts; has public => (is => 'rwp'); has _private => (is => 'rwp'); } validate_class TestClass => ( methods => [qw{ public _set_public _private _set__private }], attributes => [ public => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => 'public', writer => '_set_public', clearer => undef, builder => undef, default => undef, predicate => undef, }, _private => { -isa => ['Moose::Meta::Attribute'], -does => [Shortcuts], reader => '_private', writer => '_set__private', clearer => undef, builder => undef, default => undef, predicate => undef, }, ], ); done_testing; MooseX-AttributeShortcuts-0.037/t/funcs.pm0000640000175100017510000000514213204655723020417 0ustar maxmindmaxmind# # This file is part of MooseX-AttributeShortcuts # # This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use constant Shortcuts => 'MooseX::AttributeShortcuts::Trait::Attribute'; sub test_class { my $classname = shift @_; my $writer_prefix = shift @_ || '_set_'; my $builder_prefix = shift @_ || '_build_'; test_class_sanity_checks($classname, qw{ foo bar baz }); my $meta = $classname->meta; my ($foo, $bar, $baz) = map { $meta->get_attribute($_) } qw{ foo bar baz }; is($_->reader, $_->name, $_->name . ': reader => correct') for $foo, $bar, $baz; is($_->writer, $writer_prefix . $_->name, $_->name . ': writer => correct') for $foo, $baz; is($_->writer, undef, $_->name . ': writer => correct (undef)') for $bar; is($_->builder, undef, $_->name . ': builder => correct (undef)') for $foo; is($_->accessor, undef, $_->name . ': accessor => correct (undef)') for $foo, $bar, $baz; is($_->builder, $builder_prefix . $_->name, $_->name . ': builder => correct') for $bar, $baz; } sub test_class_sanity_checks { my ($classname, @attributes) = @_; # sanity checks meta_ok($classname); does_ok( $classname->meta->attribute_metaclass, 'MooseX::AttributeShortcuts::Trait::Attribute', ); has_attribute_ok($classname, $_) for @attributes; ok($classname->meta->get_attribute($_)->does(Shortcuts), "does role: $_") for @attributes; return; } sub check_attribute { my ($class, $name, %accessors) = @_; has_attribute_ok($class, $name); my $att = $class->meta->get_attribute($name); my $check = sub { my $property = $_; my $value = $accessors{$property}; my $has = "has_$property"; defined $value ? ok($att->$has, "$name has $property") : ok(!$att->$has, "$name does not have $property") ; is($att->$property, $value, "$name: $property correct") }; $check->() for grep { ! /(init_arg|lazy)/ } keys %accessors; if (exists $accessors{init_arg}) { if ($accessors{init_arg}) { local $_ = 'init_arg'; $check->(); } else { ok(!$att->has_init_arg, "$name has no init_arg"); } } if (exists $accessors{lazy} && $accessors{lazy}) { ok($att->is_lazy, "$name is lazy"); } elsif (exists $accessors{lazy} && !$accessors{lazy}) { is(!$att->is_lazy, "$name is not lazy"); } return; } 1; MooseX-AttributeShortcuts-0.037/SIGNATURE0000644000175100017510000001300113204655723017761 0ustar maxmindmaxmindThis file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.81. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 SHA1 a76fa1dfc018a4cfd8b958516756622f64348161 .travis.yml SHA1 558ac1c717f4fb699280d71666dca37d48657880 Changes SHA1 8c3363843c9427feb1cbf7b748aff30fc448ce49 LICENSE SHA1 10c240726de395ea2a0984d76d9af527166a3f82 MANIFEST SHA1 29b6f46afac82c1625fa56dc80c9978f21858a71 META.json SHA1 439d4316832dbbcac5adfaff3122a062b9743c37 META.yml SHA1 debbefae98468ec564db38aafc0602ca94c822cb Makefile.PL SHA1 32fffeeda9e2716b069168f2f99035f125efbc12 README SHA1 626324c49177821f9488a40f834759b4aa98a757 cpanfile SHA1 c406a195c7ae3c97aef628c944c408259a1580fe dist.ini SHA1 5b78ed43ef30374ab35473a13780a34127e855d9 lib/MooseX/AttributeShortcuts.pm SHA1 7a6942f20e399ff9cdd93b2c30bfa716faabae9b lib/MooseX/AttributeShortcuts/Trait/Attribute.pm SHA1 cb5521863af0fd9aa523321db8ea154260cecbdd lib/MooseX/AttributeShortcuts/Trait/Attribute/HasAnonBuilder.pm SHA1 51d53caa87f3d20f8642a93a0cdd4a6c44a80c37 lib/MooseX/AttributeShortcuts/Trait/Method/Builder.pm SHA1 e008abd613aac08928413844570c3d36e0593699 lib/MooseX/AttributeShortcuts/Trait/Method/HasDefinitionContext.pm SHA1 a31b23ffbfd31ed48041500a5d7334c6877b765e lib/MooseX/AttributeShortcuts/Trait/Role/Attribute.pm SHA1 82118b49c290c78e9315d0cbb827db4c88a07fd7 lib/MooseX/AttributeShortcuts/Trait/Role/Method/Builder.pm SHA1 4bdb7637c377a4563e26e887313ef118c1d1a22d t/00-check-deps.t SHA1 bc4fa164d24143e5b8d5c973f9f562088476ea9b t/00-compile.t SHA1 35acce97e38c5a466cd8dffafbfb6ff9552f0078 t/00-report-prereqs.dd SHA1 a325b35cd3d7c0b7e852e993b0c1058caa4490e1 t/00-report-prereqs.t SHA1 6e5ff5b73ac86b06b924cc48e9090a29e04eeefa t/02-parameterized.t SHA1 d911b985b0842c8e771d2f301383ae8e23de9c19 t/03-lazy.t SHA1 8f69e6e8d0f7349405a2266ba949c680d2eb9014 t/05-extend.t SHA1 3a08df42847426d463259d8947242bb3c0a2974c t/06-role.t SHA1 d9a360ac4ea0ebef915ba38768e8ab2e5cd91da7 t/builder/basic.t SHA1 8d6ea1892867c59580ba2e4ac7f3fd4d8031f964 t/builder/inline-builder-conflict-toclass.t SHA1 af5bf4f00ebb1ff7680280115a656c9a01c05fc0 t/builder/inline-builder-conflict-torole.t SHA1 bcacdbfa83cceeb97e53b92f3247789d2ad72368 t/builder/inline-definition-context.t SHA1 323272fee90097c87aca07024156a38b67c24361 t/builder/inline-role-role-class.t SHA1 9d0ea8608c6b94fe10d9fde56f98dd3a91772737 t/builder/inline.t SHA1 c05f7e78b52fd62e7d252396b60338e2595bc9a1 t/clearer.t SHA1 cdb770dcc3e7834ebfef966b99b65696b4bebfe9 t/constraint.t SHA1 947381506e1c2495852eba7dd715cea2476264e0 t/funcs.pm SHA1 27136968a8b6a891afba12ed77578337ff311d8d t/handles/coderef-class.t SHA1 6704194966b41752902fe8fc984cd7f5c4fe3153 t/handles/coderef.t SHA1 2a3a2473622b9bd48532a52cfb1aafe72a0d34af t/handles/metaclass.t SHA1 fe7c5e14d225e667ef5d8134e52576a31bd6c085 t/init_arg.t SHA1 efa514912dc489236506a5a9aca8414a6b661e52 t/inline_subtyping/basic.t SHA1 78aee97e4cb5687712f41fae37fd800cd1fe3ac7 t/inline_subtyping/coercion.t SHA1 2b9133942088af2b4b6926c65d7b2da8beb1f2b6 t/inline_subtyping/with_coercion.t SHA1 9da29af7d141935d1438bac646524289c4173488 t/is/rwp.t SHA1 55d5cc1a7feafab1e88a9cbeb7975f1ec0be7721 t/isa/mooish.t SHA1 801cfa02cf426ab31f6b1f9465cbc89d78822743 t/isa_instance_of.t SHA1 95cb96ace59a0742b4af8e1409e099b7cb880472 t/metaclasses.t SHA1 d7c14aee6244cb650d3242c741c5fb6a6e15bc74 t/old/01-basic.t SHA1 ab3c033b6c483c2c843e299ebceb3613745a7fcc t/old/04-clearer-and-predicate.t SHA1 c875cbecfd4b18c98c0dd2efed0e240ba4306a35 t/old/07-trigger.t SHA1 771c13fb730f9305e6b4253a2a96668397317014 t/others/semiaffordanceaccessor.t SHA1 bfd3bbf9d0cce9d776ca7a1a6d01745b26bc3b7b t/predicate.t SHA1 3cecf2110b71875b121c7788bdb70e669cbbcca2 t/trigger.t SHA1 3e24fb6cf2abf167b302ed854ff7548a8506c301 xt/author/eol.t SHA1 c663dd6cb92cd4e7f088d523a4ae5165a128800e xt/author/no-tabs.t SHA1 0559ee48678416f7fe3dd2da8d858854fa58d37b xt/author/pod-coverage.t SHA1 7ff9e063382140b61258c872e951d58ce7628482 xt/author/pod-linkcheck.t SHA1 a9f4dec9778b475e93e21ee1b844968e98518b4e xt/author/pod-spell.t SHA1 5375da63551c2f6e2736b998c0b64e32d8fb93fc xt/author/pod-syntax.t SHA1 a7948d34cfaad400286ea5d5fa6206c4c7e2552c xt/release/consistent-version.t SHA1 302b5f5c926586a890586cfafdd2029f213ba4bd xt/release/has-version.t SHA1 d148df4b53cdb64138d3081f2968bf4e18276651 xt/release/minimum-version.t SHA1 63defd4e51b3a1479e76c5aca10440d9e7a07c2f xt/release/no-smart-comments.t -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEqvAjTK4OlkLFh465K77AqDC8C58FAloTW74ACgkQK77AqDC8 C5+kLhAAmmdSpk2R7RqD2BPGsIhOgzdz9TI9TjVI3uSTBr0zWr3f2ClNrw6cNpTe iNMbQ39dTbsuUbWN13sG2XbTrMqkc0ye5jWZ6UiR6wEB4YzqUAC1UtFj8DS5m+G5 9+HPVhobvlaz2zdHcjwFHkGNuYZvEMqXdzoMQ3xGEbFZLB1CQ00QbnwsC7oumnit z1vXf6tW1y43SfY4aFba1UxztunaBXzSz77pqDIP6YCdIEI+2zRiCHxxGtHYIEX3 39DNEcpCeDIGPixjBYUXmUApVeVxovfDW5ahXnGHO2xL/YZ7yGGtdG7Wmkx5bOKH a4VvYiheq4XHq06NsFC502+cIhPG5WCdC8w6DxcemjcuPZeir4JgpNKrDMg+5oVJ pt6L+zYW4OWkBBxts7EgZwVDd8KCfIs1QYgEoZ6n+UtVzBO0nE0j5H/EoVVKI0nM rUNsl0ekl1NnZu9wR5mGoIH6zUOVwu1YpVheyS7u3ImL2VGqCNj9tGftYmXfAn3q agt0jqSW6DDGUCbXBEurB+RLOhv086kuKU/Ps54hL6iyHroKE2MJ8tNqBX3fEi9Q gA5MTJORVX1OmTI/6ruZJisp+A6RPqfCjwf2Vv0RGuiBtBMoqhLKUcqKqMSUQDz3 kYhwhZTNqjM6I7OQw3qZJFh061Ikkzgy/RQOUgpN/2QGtCb4yhM= =h2Vz -----END PGP SIGNATURE----- MooseX-AttributeShortcuts-0.037/META.json0000644000175100017510000011575413204655723020140 0ustar maxmindmaxmind{ "abstract" : "Shorthand for common attribute options", "author" : [ "Chris Weyl " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150010", "license" : [ "lgpl_2_1" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "MooseX-AttributeShortcuts", "no_index" : { "directory" : [ "corpus", "t" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "perl" : "5.006" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Pod::Wordlist" : "0", "Test::ConsistentVersion" : "0", "Test::EOL" : "0", "Test::HasVersion" : "0", "Test::MinimumVersion" : "0", "Test::More" : "0.88", "Test::NoSmartComments" : "0", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::LinkCheck" : "0", "Test::Spelling" : "0.12" } }, "runtime" : { "requires" : { "List::Util" : "1.33", "Moose" : "1.14", "Moose::Exporter" : "0", "Moose::Meta::TypeConstraint" : "0", "Moose::Role" : "0", "Moose::Util::MetaRole" : "0", "Moose::Util::TypeConstraints" : "0", "MooseX::Meta::TypeConstraint::Mooish" : "0", "MooseX::Role::Parameterized" : "0", "MooseX::Types::Common::String" : "0", "MooseX::Types::Moose" : "0", "MooseX::Util" : "0", "aliased" : "0", "namespace::autoclean" : "0.24", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Moose::Util" : "0", "MooseX::Types::Path::Class" : "0", "Path::Class" : "0", "Test::CheckDeps" : "0.010", "Test::Fatal" : "0", "Test::Moose" : "0", "Test::Moose::More" : "0.049", "Test::More" : "0.94", "Test::Requires" : "0", "constant" : "0", "lib" : "0", "perl" : "5.006" }, "suggests" : { "MooseX::SemiAffordanceAccessor" : "0" } } }, "provides" : { "MooseX::AttributeShortcuts" : { "file" : "lib/MooseX/AttributeShortcuts.pm", "version" : "0.037" }, "MooseX::AttributeShortcuts::Trait::Attribute" : { "file" : "lib/MooseX/AttributeShortcuts/Trait/Attribute.pm", "version" : "0.037" }, "MooseX::AttributeShortcuts::Trait::Attribute::HasAnonBuilder" : { "file" : "lib/MooseX/AttributeShortcuts/Trait/Attribute/HasAnonBuilder.pm", "version" : "0.037" }, "MooseX::AttributeShortcuts::Trait::Method::Builder" : { "file" : "lib/MooseX/AttributeShortcuts/Trait/Method/Builder.pm", "version" : "0.037" }, "MooseX::AttributeShortcuts::Trait::Method::HasDefinitionContext" : { "file" : "lib/MooseX/AttributeShortcuts/Trait/Method/HasDefinitionContext.pm", "version" : "0.037" }, "MooseX::AttributeShortcuts::Trait::Role::Attribute" : { "file" : "lib/MooseX/AttributeShortcuts/Trait/Role/Attribute.pm", "version" : "0.037" }, "MooseX::AttributeShortcuts::Trait::Role::Method::Builder" : { "file" : "lib/MooseX/AttributeShortcuts/Trait/Role/Method/Builder.pm", "version" : "0.037" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/RsrchBoy/moosex-attributeshortcuts/issues" }, "homepage" : "https://github.com/RsrchBoy/moosex-attributeshortcuts", "repository" : { "type" : "git", "url" : "https://github.com/RsrchBoy/moosex-attributeshortcuts.git", "web" : "https://github.com/RsrchBoy/moosex-attributeshortcuts" } }, "version" : "0.037", "x_BuiltWith" : { "modules" : { "CPAN::Meta" : "2.150010", "ExtUtils::MakeMaker" : "7.30", "File::Spec" : "3.67", "IO::Handle" : "1.36", "IPC::Open3" : "1.20", "List::Util" : "1.49", "Moose" : "2.2006", "Moose::Exporter" : "2.2006", "Moose::Meta::TypeConstraint" : "2.2006", "Moose::Role" : "2.2006", "Moose::Util" : "2.2006", "Moose::Util::MetaRole" : "2.2006", "Moose::Util::TypeConstraints" : "2.2006", "MooseX::Meta::TypeConstraint::Mooish" : "0.001", "MooseX::Role::Parameterized" : "1.10", "MooseX::SemiAffordanceAccessor" : "0.10", "MooseX::Types::Common::String" : "0.001014", "MooseX::Types::Moose" : "0.50", "MooseX::Types::Path::Class" : "0.09", "MooseX::Util" : "0.006", "Path::Class" : "0.37", "Pod::Coverage::TrustPod" : "0.100003", "Pod::Wordlist" : "1.20", "Test::CheckDeps" : "0.010", "Test::ConsistentVersion" : "0.3.0", "Test::EOL" : "2.00", "Test::Fatal" : "0.014", "Test::HasVersion" : "0.014", "Test::MinimumVersion" : "0.101082", "Test::Moose" : "2.2006", "Test::Moose::More" : "0.050", "Test::More" : "1.302106", "Test::NoSmartComments" : "0.005", "Test::NoTabs" : "2.00", "Test::Pod" : "1.51", "Test::Pod::Coverage" : "1.10", "Test::Pod::LinkCheck" : "0.008", "Test::Requires" : "0.10", "Test::Spelling" : "0.20", "aliased" : "0.34", "constant" : "1.33", "lib" : "0.64", "namespace::autoclean" : "0.28", "strict" : "1.11", "warnings" : "1.37" }, "perl" : { "original" : "v5.26.1", "qv" : 1, "version" : [ 5, 26, 1 ] }, "platform" : "linux" }, "x_Dist_Zilla" : { "perl" : { "version" : "5.026001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RSRCHBOY/NextRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.001", "version_by_branch" : 0, "version_regexp" : "(?^:^(\\d.\\d+(_\\d\\d)?)(-TRIAL|)$)" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." } }, "name" : "@RSRCHBOY/Git::NextVersion", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::CopyrightYearFromGit", "name" : "@RSRCHBOY/CopyrightYearFromGit", "version" : "0.003" }, { "class" : "Dist::Zilla::Plugin::ContributorsFromGit", "name" : "@RSRCHBOY/ContributorsFromGit", "version" : "0.019" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." } }, "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::CorrectBranch", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::Fixups", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." } }, "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::Fixups", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." } }, "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::MergeConflicts", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "LICENSE" ], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@RSRCHBOY/Git::GatherDir", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla", "Dist::Zilla::PluginBundle::RSRCHBOY" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@RSRCHBOY/PromptIfStale", "version" : "0.054" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RSRCHBOY/PruneCruft", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Git::Describe", "name" : "@RSRCHBOY/Git::Describe", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RSRCHBOY/ExecDir", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RSRCHBOY/ShareDir", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@RSRCHBOY/MakeMaker", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RSRCHBOY/Manifest", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::SurgicalPkgVersion", "name" : "@RSRCHBOY/SurgicalPkgVersion", "version" : "0.0019" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@RSRCHBOY/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@RSRCHBOY/Test::ReportPrereqs", "version" : "0.027" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RSRCHBOY/AutoPrereqs", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Prepender", "name" : "@RSRCHBOY/Prepender", "version" : "2.004" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@RSRCHBOY/AuthorBundleDevelopRequires", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [ "bin", "lib" ], "spell_cmd" : "", "stopwords" : [ "ABEND", "AFAICT", "Formattable", "Gratipay", "PayPal", "RSRCHBOY", "RSRCHBOY's", "codebase", "coderef", "formattable", "gpg", "implementers", "ini", "metaclass", "metaclasses", "parameterization", "parameterized", "subclasses" ], "wordlist" : "Pod::Wordlist" } }, "name" : "@RSRCHBOY/Test::PodSpelling", "version" : "2.007004" }, { "class" : "Dist::Zilla::Plugin::ConsistentVersionTest", "name" : "@RSRCHBOY/ConsistentVersionTest", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@RSRCHBOY/PodCoverageTests", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RSRCHBOY/PodSyntaxTests", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ] } }, "name" : "@RSRCHBOY/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":ExecFiles", ":InstallModules", ":TestFiles" ], "trailing_whitespace" : 1 } }, "name" : "@RSRCHBOY/Test::EOL", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::HasVersionTests", "name" : "@RSRCHBOY/HasVersionTests", "version" : "1.101420" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 0, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "test", "script_finder" : [ ":PerlExecFiles" ], "skips" : [], "switch" : [] } }, "name" : "@RSRCHBOY/Test::Compile", "version" : "2.057" }, { "class" : "Dist::Zilla::Plugin::NoSmartCommentsTests", "name" : "@RSRCHBOY/NoSmartCommentsTests", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::LinkCheck", "name" : "@RSRCHBOY/Test::Pod::LinkCheck", "version" : "1.004" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@RSRCHBOY/RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "name" : "@RSRCHBOY/Test::MinimumVersion", "version" : "2.000007" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@RSRCHBOY/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RSRCHBOY/MetaConfig", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RSRCHBOY/MetaJSON", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RSRCHBOY/MetaYAML", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@RSRCHBOY/MetaNoIndex", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.010" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 1, "inherit_version" : 1, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.004" } }, "name" : "@RSRCHBOY/MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::MetaData::BuiltWith", "config" : { "Dist::Zilla::Plugin::MetaData::BuiltWith" : { "$Module::Metadata::VERSION" : "1.000033", "_stash_key" : "x_BuiltWith", "external_file_name" : "misc/built_with.json", "show_config" : 0, "show_uname" : 0, "use_external_file" : null } }, "name" : "@RSRCHBOY/MetaData::BuiltWith", "version" : "1.004005" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@RSRCHBOY/GithubMeta", "version" : "0.54" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RSRCHBOY/TestRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", "name" : "@RSRCHBOY/CheckChangesHasContent", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RSRCHBOY/CheckPrereqsIndexed", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Update", "name" : "@RSRCHBOY/GitFetchOrigin", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@RSRCHBOY/GitCheckReleaseBranchSync", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@RSRCHBOY/GitCheckMasterBranchSync", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ ".gitignore", ".travis.yml", "Changes", "LICENSE", "README.mkdn", "dist.ini", "weaver.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." } }, "name" : "@RSRCHBOY/Git::Check", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%v%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ ".gitignore", ".travis.yml", "Changes", "LICENSE", "README.mkdn", "dist.ini", "weaver.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RSRCHBOY/Git::Commit", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Test::CheckDeps", "config" : { "Dist::Zilla::Plugin::Test::CheckDeps" : { "fatal" : 1, "filename" : "t/00-check-deps.t", "level" : "suggests", "todo_when" : "0" } }, "name" : "@RSRCHBOY/Test::CheckDeps", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.004" } }, "name" : "@RSRCHBOY/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Travis::ConfigForReleaseBranch", "name" : "@RSRCHBOY/Travis::ConfigForReleaseBranch", "version" : "0.005" }, { "class" : "Dist::Zilla::Plugin::SchwartzRatio", "name" : "@RSRCHBOY/SchwartzRatio", "version" : "0.3.2" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 1, "tag" : "0.037", "tag_format" : "%v", "tag_message" : "v%v" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RSRCHBOY/Git::Tag", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::CommitBuild", "config" : { "Dist::Zilla::Plugin::Git::CommitBuild" : { "branch" : "build/%b", "build_root" : null, "message" : "Build results of %h (on %b)", "multiple_inheritance" : 0, "release_branch" : null, "release_message" : "Build results of %h (on %b)" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." } }, "name" : "@RSRCHBOY/Git::CommitBuild::Build", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::CommitBuild", "config" : { "Dist::Zilla::Plugin::Git::CommitBuild" : { "branch" : "build/%b", "build_root" : null, "message" : "Build results of %h (on %b)", "multiple_inheritance" : 1, "release_branch" : "release/cpan", "release_message" : "Full build of CPAN release %v%t" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." } }, "name" : "@RSRCHBOY/Git::CommitBuild::Release", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin", "origin refs/heads/release/cpan:refs/heads/release/cpan" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.15.0", "repo_root" : "." } }, "name" : "@RSRCHBOY/Git::Push", "version" : "2.042" }, { "class" : "Dist::Zilla::Plugin::Twitter", "name" : "@RSRCHBOY/Twitter", "version" : "0.026" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RSRCHBOY/UploadToCPAN", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::Signature", "name" : "@RSRCHBOY/Signature", "version" : "1.100930" }, { "class" : "Dist::Zilla::Plugin::InstallRelease", "name" : "@RSRCHBOY/InstallRelease", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "config" : { "Dist::Zilla::Plugin::GitHub::Update" : { "metacpan" : 1 } }, "name" : "@RSRCHBOY/GitHub::Update", "version" : "0.44" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 0, "run" : [ "mkdir -p releases ; mv %s releases/" ], "version" : "0.046" } }, "name" : "@RSRCHBOY/Run::AfterRelease", "version" : "0.046" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RSRCHBOY/ConfirmRelease", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RSRCHBOY/License", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::CPANFile", "name" : "@RSRCHBOY/CPANFile", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@RSRCHBOY/ReadmeMarkdownInRoot", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@RSRCHBOY/ReadmeTxt", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromBuild", "name" : "@RSRCHBOY/CopyFilesFromBuild", "version" : "0.170880" }, { "class" : "Dist::Zilla::Plugin::GitHubREADME::Badge", "name" : "@RSRCHBOY/GitHubREADME::Badge", "version" : "0.22" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@RSRCHBOY" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::StopWords", "name" : "@RSRCHBOY/StopWords", "version" : "1.010" }, { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@RSRCHBOY/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@RSRCHBOY/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RSRCHBOY/prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "EXTENDS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "IMPLEMENTS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "CONSUMES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::RSRCHBOY::RoleParameters", "name" : "ROLE PARAMETERS", "version" : "0.075" }, { "class" : "Pod::Weaver::Section::RSRCHBOY::RequiredAttributes", "name" : "REQUIRED ATTRIBUTES", "version" : "0.075" }, { "class" : "Pod::Weaver::Section::RSRCHBOY::LazyAttributes", "name" : "LAZY ATTRIBUTES", "version" : "0.075" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "REQUIRED METHODS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "BEFORE METHOD MODIFIERS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "AROUND METHOD MODIFIERS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "AFTER METHOD MODIFIERS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "PRIVATE METHODS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "TYPES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "TEST FUNCTIONS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@RSRCHBOY/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RSRCHBOY/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::SeeAlso", "name" : "@RSRCHBOY/SeeAlso", "version" : "1.003" }, { "class" : "Pod::Weaver::Section::Bugs", "name" : "@RSRCHBOY/Bugs", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::RSRCHBOY::Authors", "name" : "RSRCHBOY::Authors", "version" : "0.075" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@RSRCHBOY/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@RSRCHBOY/Legal", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@RSRCHBOY/List", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@RSRCHBOY/SingleEncoding", "version" : "4.015" } ] } }, "name" : "@RSRCHBOY/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "suggests" } }, "name" : "Prereqs", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.010" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.010" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.010" } }, "x_authority" : "cpan:RSRCHBOY", "x_contributors" : [ "David Steinbrunner ", "Graham Knop ", "Karen Etheridge ", "Olaf Alders " ], "x_serialization_backend" : "Cpanel::JSON::XS version 3.0239" } MooseX-AttributeShortcuts-0.037/cpanfile0000644000175100017510000000370613204655723020214 0ustar maxmindmaxmindrequires "List::Util" => "1.33"; requires "Moose" => "1.14"; requires "Moose::Exporter" => "0"; requires "Moose::Meta::TypeConstraint" => "0"; requires "Moose::Role" => "0"; requires "Moose::Util::MetaRole" => "0"; requires "Moose::Util::TypeConstraints" => "0"; requires "MooseX::Meta::TypeConstraint::Mooish" => "0"; requires "MooseX::Role::Parameterized" => "0"; requires "MooseX::Types::Common::String" => "0"; requires "MooseX::Types::Moose" => "0"; requires "MooseX::Util" => "0"; requires "aliased" => "0"; requires "namespace::autoclean" => "0.24"; requires "perl" => "5.006"; requires "strict" => "0"; requires "warnings" => "0"; on 'test' => sub { requires "ExtUtils::MakeMaker" => "0"; requires "File::Spec" => "0"; requires "IO::Handle" => "0"; requires "IPC::Open3" => "0"; requires "Moose::Util" => "0"; requires "MooseX::Types::Path::Class" => "0"; requires "Path::Class" => "0"; requires "Test::CheckDeps" => "0.010"; requires "Test::Fatal" => "0"; requires "Test::Moose" => "0"; requires "Test::Moose::More" => "0.049"; requires "Test::More" => "0.94"; requires "Test::Requires" => "0"; requires "constant" => "0"; requires "lib" => "0"; requires "perl" => "5.006"; }; on 'test' => sub { recommends "CPAN::Meta" => "2.120900"; }; on 'test' => sub { suggests "MooseX::SemiAffordanceAccessor" => "0"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; requires "perl" => "5.006"; }; on 'develop' => sub { requires "Pod::Coverage::TrustPod" => "0"; requires "Pod::Wordlist" => "0"; requires "Test::ConsistentVersion" => "0"; requires "Test::EOL" => "0"; requires "Test::HasVersion" => "0"; requires "Test::MinimumVersion" => "0"; requires "Test::More" => "0.88"; requires "Test::NoSmartComments" => "0"; requires "Test::NoTabs" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; requires "Test::Pod::LinkCheck" => "0"; requires "Test::Spelling" => "0.12"; }; MooseX-AttributeShortcuts-0.037/META.yml0000644000175100017510000006302013204655723017754 0ustar maxmindmaxmind--- abstract: 'Shorthand for common attribute options' author: - 'Chris Weyl ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Moose::Util: '0' MooseX::Types::Path::Class: '0' Path::Class: '0' Test::CheckDeps: '0.010' Test::Fatal: '0' Test::Moose: '0' Test::Moose::More: '0.049' Test::More: '0.94' Test::Requires: '0' constant: '0' lib: '0' perl: '5.006' configure_requires: ExtUtils::MakeMaker: '0' perl: '5.006' dynamic_config: '0' generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version 2.150010' license: lgpl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: MooseX-AttributeShortcuts no_index: directory: - corpus - t provides: MooseX::AttributeShortcuts: file: lib/MooseX/AttributeShortcuts.pm version: '0.037' MooseX::AttributeShortcuts::Trait::Attribute: file: lib/MooseX/AttributeShortcuts/Trait/Attribute.pm version: '0.037' MooseX::AttributeShortcuts::Trait::Attribute::HasAnonBuilder: file: lib/MooseX/AttributeShortcuts/Trait/Attribute/HasAnonBuilder.pm version: '0.037' MooseX::AttributeShortcuts::Trait::Method::Builder: file: lib/MooseX/AttributeShortcuts/Trait/Method/Builder.pm version: '0.037' MooseX::AttributeShortcuts::Trait::Method::HasDefinitionContext: file: lib/MooseX/AttributeShortcuts/Trait/Method/HasDefinitionContext.pm version: '0.037' MooseX::AttributeShortcuts::Trait::Role::Attribute: file: lib/MooseX/AttributeShortcuts/Trait/Role/Attribute.pm version: '0.037' MooseX::AttributeShortcuts::Trait::Role::Method::Builder: file: lib/MooseX/AttributeShortcuts/Trait/Role/Method/Builder.pm version: '0.037' requires: List::Util: '1.33' Moose: '1.14' Moose::Exporter: '0' Moose::Meta::TypeConstraint: '0' Moose::Role: '0' Moose::Util::MetaRole: '0' Moose::Util::TypeConstraints: '0' MooseX::Meta::TypeConstraint::Mooish: '0' MooseX::Role::Parameterized: '0' MooseX::Types::Common::String: '0' MooseX::Types::Moose: '0' MooseX::Util: '0' aliased: '0' namespace::autoclean: '0.24' perl: '5.006' strict: '0' warnings: '0' resources: bugtracker: https://github.com/RsrchBoy/moosex-attributeshortcuts/issues homepage: https://github.com/RsrchBoy/moosex-attributeshortcuts repository: https://github.com/RsrchBoy/moosex-attributeshortcuts.git version: '0.037' x_BuiltWith: modules: CPAN::Meta: '2.150010' ExtUtils::MakeMaker: '7.30' File::Spec: '3.67' IO::Handle: '1.36' IPC::Open3: '1.20' List::Util: '1.49' Moose: '2.2006' Moose::Exporter: '2.2006' Moose::Meta::TypeConstraint: '2.2006' Moose::Role: '2.2006' Moose::Util: '2.2006' Moose::Util::MetaRole: '2.2006' Moose::Util::TypeConstraints: '2.2006' MooseX::Meta::TypeConstraint::Mooish: '0.001' MooseX::Role::Parameterized: '1.10' MooseX::SemiAffordanceAccessor: '0.10' MooseX::Types::Common::String: '0.001014' MooseX::Types::Moose: '0.50' MooseX::Types::Path::Class: '0.09' MooseX::Util: '0.006' Path::Class: '0.37' Pod::Coverage::TrustPod: '0.100003' Pod::Wordlist: '1.20' Test::CheckDeps: '0.010' Test::ConsistentVersion: 0.3.0 Test::EOL: '2.00' Test::Fatal: '0.014' Test::HasVersion: '0.014' Test::MinimumVersion: '0.101082' Test::Moose: '2.2006' Test::Moose::More: '0.050' Test::More: '1.302106' Test::NoSmartComments: '0.005' Test::NoTabs: '2.00' Test::Pod: '1.51' Test::Pod::Coverage: '1.10' Test::Pod::LinkCheck: '0.008' Test::Requires: '0.10' Test::Spelling: '0.20' aliased: '0.34' constant: '1.33' lib: '0.64' namespace::autoclean: '0.28' strict: '1.11' warnings: '1.37' perl: original: v5.26.1 qv: 1 version: - 5 - 26 - 1 platform: linux x_Dist_Zilla: perl: version: '5.026001' plugins: - class: Dist::Zilla::Plugin::NextRelease name: '@RSRCHBOY/NextRelease' version: '6.010' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.001' version_by_branch: '0' version_regexp: (?^:^(\d.\d+(_\d\d)?)(-TRIAL|)$) Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . name: '@RSRCHBOY/Git::NextVersion' version: '2.042' - class: Dist::Zilla::Plugin::CopyrightYearFromGit name: '@RSRCHBOY/CopyrightYearFromGit' version: '0.003' - class: Dist::Zilla::Plugin::ContributorsFromGit name: '@RSRCHBOY/ContributorsFromGit' version: '0.019' - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch config: Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::CorrectBranch' version: '0.014' - class: Dist::Zilla::Plugin::Git::CheckFor::Fixups config: Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::Fixups' version: '0.014' - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts config: Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::MergeConflicts' version: '0.014' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - LICENSE exclude_match: [] follow_symlinks: '0' include_dotfiles: '0' prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: '0' name: '@RSRCHBOY/Git::GatherDir' version: '2.042' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: '0' check_all_prereqs: '0' modules: - Dist::Zilla - Dist::Zilla::PluginBundle::RSRCHBOY phase: build run_under_travis: '0' skip: [] name: '@RSRCHBOY/PromptIfStale' version: '0.054' - class: Dist::Zilla::Plugin::PruneCruft name: '@RSRCHBOY/PruneCruft' version: '6.010' - class: Dist::Zilla::Plugin::Git::Describe name: '@RSRCHBOY/Git::Describe' version: '0.007' - class: Dist::Zilla::Plugin::ExecDir name: '@RSRCHBOY/ExecDir' version: '6.010' - class: Dist::Zilla::Plugin::ShareDir name: '@RSRCHBOY/ShareDir' version: '6.010' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: '1' name: '@RSRCHBOY/MakeMaker' version: '6.010' - class: Dist::Zilla::Plugin::Manifest name: '@RSRCHBOY/Manifest' version: '6.010' - class: Dist::Zilla::Plugin::SurgicalPkgVersion name: '@RSRCHBOY/SurgicalPkgVersion' version: '0.0019' - class: Dist::Zilla::Plugin::MinimumPerl name: '@RSRCHBOY/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@RSRCHBOY/Test::ReportPrereqs' version: '0.027' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RSRCHBOY/AutoPrereqs' version: '6.010' - class: Dist::Zilla::Plugin::Prepender name: '@RSRCHBOY/Prepender' version: '2.004' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@RSRCHBOY/AuthorBundleDevelopRequires' version: '6.010' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: - bin - lib spell_cmd: '' stopwords: - ABEND - AFAICT - Formattable - Gratipay - PayPal - RSRCHBOY - "RSRCHBOY's" - codebase - coderef - formattable - gpg - implementers - ini - metaclass - metaclasses - parameterization - parameterized - subclasses wordlist: Pod::Wordlist name: '@RSRCHBOY/Test::PodSpelling' version: '2.007004' - class: Dist::Zilla::Plugin::ConsistentVersionTest name: '@RSRCHBOY/ConsistentVersionTest' version: '0.03' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@RSRCHBOY/PodCoverageTests' version: '6.010' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RSRCHBOY/PodSyntaxTests' version: '6.010' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' name: '@RSRCHBOY/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':ExecFiles' - ':InstallModules' - ':TestFiles' trailing_whitespace: '1' name: '@RSRCHBOY/Test::EOL' version: '0.19' - class: Dist::Zilla::Plugin::HasVersionTests name: '@RSRCHBOY/HasVersionTests' version: '1.101420' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: '0' filename: t/00-compile.t module_finder: - ':InstallModules' needs_display: '0' phase: test script_finder: - ':PerlExecFiles' skips: [] switch: [] name: '@RSRCHBOY/Test::Compile' version: '2.057' - class: Dist::Zilla::Plugin::NoSmartCommentsTests name: '@RSRCHBOY/NoSmartCommentsTests' version: '0.009' - class: Dist::Zilla::Plugin::Test::Pod::LinkCheck name: '@RSRCHBOY/Test::Pod::LinkCheck' version: '1.004' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: '1' name: '@RSRCHBOY/RunExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::Test::MinimumVersion name: '@RSRCHBOY/Test::MinimumVersion' version: '2.000007' - class: Dist::Zilla::Plugin::Authority name: '@RSRCHBOY/Authority' version: '1.009' - class: Dist::Zilla::Plugin::MetaConfig name: '@RSRCHBOY/MetaConfig' version: '6.010' - class: Dist::Zilla::Plugin::MetaJSON name: '@RSRCHBOY/MetaJSON' version: '6.010' - class: Dist::Zilla::Plugin::MetaYAML name: '@RSRCHBOY/MetaYAML' version: '6.010' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@RSRCHBOY/MetaNoIndex' version: '6.010' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: '@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.010' include_underscores: '0' Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: '1' inherit_version: '1' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.004' name: '@RSRCHBOY/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::MetaData::BuiltWith config: Dist::Zilla::Plugin::MetaData::BuiltWith: $Module::Metadata::VERSION: '1.000033' _stash_key: x_BuiltWith external_file_name: misc/built_with.json show_config: '0' show_uname: '0' use_external_file: ~ name: '@RSRCHBOY/MetaData::BuiltWith' version: '1.004005' - class: Dist::Zilla::Plugin::GithubMeta name: '@RSRCHBOY/GithubMeta' version: '0.54' - class: Dist::Zilla::Plugin::TestRelease name: '@RSRCHBOY/TestRelease' version: '6.010' - class: Dist::Zilla::Plugin::CheckChangesHasContent name: '@RSRCHBOY/CheckChangesHasContent' version: '0.010' - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RSRCHBOY/CheckPrereqsIndexed' version: '0.020' - class: Dist::Zilla::Plugin::Git::Remote::Update name: '@RSRCHBOY/GitFetchOrigin' version: 0.1.2 - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@RSRCHBOY/GitCheckReleaseBranchSync' version: 0.1.2 - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@RSRCHBOY/GitCheckMasterBranchSync' version: 0.1.2 - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - .gitignore - .travis.yml - Changes - LICENSE - README.mkdn - dist.ini - weaver.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . name: '@RSRCHBOY/Git::Check' version: '2.042' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%v%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - .gitignore - .travis.yml - Changes - LICENSE - README.mkdn - dist.ini - weaver.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RSRCHBOY/Git::Commit' version: '2.042' - class: Dist::Zilla::Plugin::Test::CheckDeps config: Dist::Zilla::Plugin::Test::CheckDeps: fatal: '1' filename: t/00-check-deps.t level: suggests todo_when: '0' name: '@RSRCHBOY/Test::CheckDeps' version: '0.014' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.004' name: '@RSRCHBOY/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::Travis::ConfigForReleaseBranch name: '@RSRCHBOY/Travis::ConfigForReleaseBranch' version: '0.005' - class: Dist::Zilla::Plugin::SchwartzRatio name: '@RSRCHBOY/SchwartzRatio' version: 0.3.2 - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: '1' tag: '0.037' tag_format: '%v' tag_message: v%v Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RSRCHBOY/Git::Tag' version: '2.042' - class: Dist::Zilla::Plugin::Git::CommitBuild config: Dist::Zilla::Plugin::Git::CommitBuild: branch: build/%b build_root: ~ message: 'Build results of %h (on %b)' multiple_inheritance: '0' release_branch: ~ release_message: 'Build results of %h (on %b)' Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . name: '@RSRCHBOY/Git::CommitBuild::Build' version: '2.042' - class: Dist::Zilla::Plugin::Git::CommitBuild config: Dist::Zilla::Plugin::Git::CommitBuild: branch: build/%b build_root: ~ message: 'Build results of %h (on %b)' multiple_inheritance: '1' release_branch: release/cpan release_message: 'Full build of CPAN release %v%t' Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . name: '@RSRCHBOY/Git::CommitBuild::Release' version: '2.042' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin - 'origin refs/heads/release/cpan:refs/heads/release/cpan' remotes_must_exist: '1' Dist::Zilla::Role::Git::Repo: git_version: 2.15.0 repo_root: . name: '@RSRCHBOY/Git::Push' version: '2.042' - class: Dist::Zilla::Plugin::Twitter name: '@RSRCHBOY/Twitter' version: '0.026' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RSRCHBOY/UploadToCPAN' version: '6.010' - class: Dist::Zilla::Plugin::Signature name: '@RSRCHBOY/Signature' version: '1.100930' - class: Dist::Zilla::Plugin::InstallRelease name: '@RSRCHBOY/InstallRelease' version: '0.008' - class: Dist::Zilla::Plugin::GitHub::Update config: Dist::Zilla::Plugin::GitHub::Update: metacpan: '1' name: '@RSRCHBOY/GitHub::Update' version: '0.44' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: '1' quiet: '0' run: - 'mkdir -p releases ; mv %s releases/' version: '0.046' name: '@RSRCHBOY/Run::AfterRelease' version: '0.046' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RSRCHBOY/ConfirmRelease' version: '6.010' - class: Dist::Zilla::Plugin::License name: '@RSRCHBOY/License' version: '6.010' - class: Dist::Zilla::Plugin::CPANFile name: '@RSRCHBOY/CPANFile' version: '6.010' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@RSRCHBOY/ReadmeMarkdownInRoot' version: '0.163250' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@RSRCHBOY/ReadmeTxt' version: '0.163250' - class: Dist::Zilla::Plugin::CopyFilesFromBuild name: '@RSRCHBOY/CopyFilesFromBuild' version: '0.170880' - class: Dist::Zilla::Plugin::GitHubREADME::Badge name: '@RSRCHBOY/GitHubREADME::Badge' version: '0.22' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@RSRCHBOY' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::StopWords name: '@RSRCHBOY/StopWords' version: '1.010' - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.015' - class: Pod::Weaver::Section::Name name: '@RSRCHBOY/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@RSRCHBOY/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@RSRCHBOY/prelude' version: '4.015' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.015' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.015' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.015' - class: Pod::Weaver::Section::Collect name: EXTENDS version: '4.015' - class: Pod::Weaver::Section::Collect name: IMPLEMENTS version: '4.015' - class: Pod::Weaver::Section::Collect name: CONSUMES version: '4.015' - class: Pod::Weaver::Section::RSRCHBOY::RoleParameters name: 'ROLE PARAMETERS' version: '0.075' - class: Pod::Weaver::Section::RSRCHBOY::RequiredAttributes name: 'REQUIRED ATTRIBUTES' version: '0.075' - class: Pod::Weaver::Section::RSRCHBOY::LazyAttributes name: 'LAZY ATTRIBUTES' version: '0.075' - class: Pod::Weaver::Section::Collect name: 'REQUIRED METHODS' version: '4.015' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.015' - class: Pod::Weaver::Section::Collect name: 'BEFORE METHOD MODIFIERS' version: '4.015' - class: Pod::Weaver::Section::Collect name: 'AROUND METHOD MODIFIERS' version: '4.015' - class: Pod::Weaver::Section::Collect name: 'AFTER METHOD MODIFIERS' version: '4.015' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.015' - class: Pod::Weaver::Section::Collect name: 'PRIVATE METHODS' version: '4.015' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.015' - class: Pod::Weaver::Section::Collect name: TYPES version: '4.015' - class: Pod::Weaver::Section::Collect name: 'TEST FUNCTIONS' version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@RSRCHBOY/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@RSRCHBOY/postlude' version: '4.015' - class: Pod::Weaver::Section::SeeAlso name: '@RSRCHBOY/SeeAlso' version: '1.003' - class: Pod::Weaver::Section::Bugs name: '@RSRCHBOY/Bugs' version: '4.015' - class: Pod::Weaver::Section::RSRCHBOY::Authors name: RSRCHBOY::Authors version: '0.075' - class: Pod::Weaver::Section::Contributors name: '@RSRCHBOY/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@RSRCHBOY/Legal' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@RSRCHBOY/List' version: '4.015' - class: Pod::Weaver::Plugin::SingleEncoding name: '@RSRCHBOY/SingleEncoding' version: '4.015' name: '@RSRCHBOY/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: suggests name: Prereqs version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.010' - class: Dist::Zilla::Plugin::FinderCode name: '@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.010' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.010' x_authority: cpan:RSRCHBOY x_contributors: - 'David Steinbrunner ' - 'Graham Knop ' - 'Karen Etheridge ' - 'Olaf Alders ' x_serialization_backend: 'YAML::Tiny version 1.70' MooseX-AttributeShortcuts-0.037/MANIFEST0000644000175100017510000000301513204655723017632 0ustar maxmindmaxmind# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.010. .travis.yml Changes LICENSE MANIFEST META.json META.yml Makefile.PL README SIGNATURE cpanfile dist.ini lib/MooseX/AttributeShortcuts.pm lib/MooseX/AttributeShortcuts/Trait/Attribute.pm lib/MooseX/AttributeShortcuts/Trait/Attribute/HasAnonBuilder.pm lib/MooseX/AttributeShortcuts/Trait/Method/Builder.pm lib/MooseX/AttributeShortcuts/Trait/Method/HasDefinitionContext.pm lib/MooseX/AttributeShortcuts/Trait/Role/Attribute.pm lib/MooseX/AttributeShortcuts/Trait/Role/Method/Builder.pm t/00-check-deps.t t/00-compile.t t/00-report-prereqs.dd t/00-report-prereqs.t t/02-parameterized.t t/03-lazy.t t/05-extend.t t/06-role.t t/builder/basic.t t/builder/inline-builder-conflict-toclass.t t/builder/inline-builder-conflict-torole.t t/builder/inline-definition-context.t t/builder/inline-role-role-class.t t/builder/inline.t t/clearer.t t/constraint.t t/funcs.pm t/handles/coderef-class.t t/handles/coderef.t t/handles/metaclass.t t/init_arg.t t/inline_subtyping/basic.t t/inline_subtyping/coercion.t t/inline_subtyping/with_coercion.t t/is/rwp.t t/isa/mooish.t t/isa_instance_of.t t/metaclasses.t t/old/01-basic.t t/old/04-clearer-and-predicate.t t/old/07-trigger.t t/others/semiaffordanceaccessor.t t/predicate.t t/trigger.t xt/author/eol.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-linkcheck.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/release/consistent-version.t xt/release/has-version.t xt/release/minimum-version.t xt/release/no-smart-comments.t MooseX-AttributeShortcuts-0.037/dist.ini0000640000175100017510000000047413204655723020147 0ustar maxmindmaxmindname = MooseX-AttributeShortcuts author = Chris Weyl license = LGPL_2_1 copyright_holder = Chris Weyl copyright_year = 2011 [@RSRCHBOY] autoprereqs_skip = ^(MooseX::SemiAffordanceAccessor)$ tweet = 1 [Prereqs] -phase = test -relationship = suggests MooseX::SemiAffordanceAccessor = 0 MooseX-AttributeShortcuts-0.037/LICENSE0000644000175100017510000006015513204655723017516 0ustar maxmindmaxmindThis software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 The GNU Lesser General Public License (LGPL) Version 2.1, February 1999 (The master copy of this license lives on the GNU website.) Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS MooseX-AttributeShortcuts-0.037/Changes0000640000175100017510000001721113204655723017773 0ustar maxmindmaxmindRevision history for MooseX-AttributeShortcuts 0.037 2017-11-20 16:48:24 CST-0600 * Add `init_arg` shortcuts. 0.036 2017-10-31 21:34:35 CDT-0500 * When creating an inline builder method's metaclass, take a copy of the attribute's own definition context; previously we were inadvertently modifying the attribute's definition context with rather less than helpful results. 0.035 2017-09-22 19:54:38 CDT-0500 * Rebrand "anonymous builders" as "inline builders" * Flavor the method metaclass with a trait that provides for definition context, and install inline builders using it. This will make it easier to use the method metaclasses to see where the builder methods came from (if you're in to that sort of thing). 0.034 2017-07-25 19:18:32 CDT-0500 * Make optional requirements optional. Thanks @ppisar! Closes #19 0.033 2017-07-24 21:52:45 CDT-0500 * Detect if MooseX::SemiAffordanceAccessor has been applied to the attribute, and conform our behaviour to it if necessary. Add some docs, tests around this. 0.032 2017-06-13 21:59:13 CDT-0500 * Move builder method name generation into its own method, provided by the common 'HasAnonBuilder' role, to allow for easier overriding when organizations decide to use non-standard builder method names that cannot be handled by changing the traits' "builder_prefix" option. 0.031 2017-05-30 22:32:27 CDT-0500 * Fix tests to run without '.' in @INC; fixes #17. * Additional tests, documentation, and examples. 0.030-TRIAL 2017-05-08 22:58:52 CDT-0500 * Move our attribute trait out into its own file. * Anonymous builder methods for attributes in roles are now created at the time the attribute is defined in the role, not when the role (attribute) is applied to a class. That is, using 'builder => sub { ... }' in a role will result in the role having the builder method. Because of this, we can now treat those methods like other role methods: aliasing, excluding, etc. 0.029 2017-05-08 22:53:18 CDT-0500 * Redo a number of tests, to improve coverage and deal with the IMPENDING DOOM of . in @INC * Add a "history" note referencing lazy_build * Additional metaclass/trait application tests * Add a 'trigger_method' attribute, to stash away the expected name of the method our generated trigger will call in the associated class * Use List::Util instead of List::AllUtils+List::MoreUtils (thanks, ether! #15) * Clarify some points in the documentation (thanks, Olaf! #10) * Drop some older methods: mi(), strengthen/weaken_value() 0.028 2015-04-07 20:45:00 PDT-0700 * 0.028. *le sigh* 0.027_02 2015-04-07 20:43:17 PDT-0700 * Moose 1.14 is now the minimum supported Moose. 0.027_01 2015-03-28 22:02:17 PDT-0700 * Break out our $_process_options into more... succinct... methods. * Add Moo-style type constraints. 0.027 2015-03-10 19:27:06 PDT-0700 * Stop using autobox, after relentless persecution by The Cabal ;) * Push out our warnings for those using undocumented bits, as we haven't released a non-dev/trial version in *ages* 0.026-TRIAL 2014-12-02 19:52:59 PST-0800 * Keep our comments dumb, even in tests. (thanks, @haarg!) 0.025-TRIAL 2014-05-22 12:51:25 PDT-0700 * This is a TRIAL release, as I'm not entirely sure of the wisdom and implementation of the following. * Allow for the creation of additional associated methods by hijacking the delegation system, a la native traits: handles => { ... => sub { ... } } 0.024 2014-05-02 12:50:57 PDT-0700 * Make the undocumented isa_* options "deprecated" ...which seems like better karma than no warning, as people really shouldn't be using these anyways, but better nice than to have it done to me someday :) 0.023 2014-04-04 21:23:33 PDT-0700 * Add isa_instance_of attribute option. 0.022 2013-09-29 00:08:39 PDT-0700 * No code changes -- released with refreshed test suite 0.021 2013-09-08 23:32:09 PDT-0700 * Drop MXCPA entirely, and incorporate the subtyping functionality 0.020_01 2013-08-26 13:33:44 PDT-0700 * Keep MXCPA quiet, for now. This is evil (hence the dev release), but should keep things status-quo until we properly integrate MXCPA functionality into MXAS proper. 0.020 2013-08-19 21:51:02 PDT-0700 * Bump CoercePerAttribute version requirement to 1.000 and update docs 0.019 2013-04-20 21:50:05 PDT-0700 * Better support inline subtyping and coercions (people who are inclined to shoot themselves in their foot will do it regardless) * Additional tests for coercions 0.018 2013-01-09 10:20:25 PST8PDT * ~~ TRIAL ~~ * If a constraint coderef is given and coercion is requested, we now copy the parent type's coercions to the anonymous child type. * Better document the constraint option and how it interacts with simple coercion. 0.017 2012-10-28 20:53:52 PST8PDT * make actually make classes immutable during tests * add initial primitive anonymous inline subtyping support; this needs to be evaluated with the outstanding pull request (issue #6) but I need this Right Now 0.016 2012-09-08 21:41:38 America/Los_Angeles * provide for "negative shortcuts" for clearer and predicate, but don't document for the moment 0.015 2012-08-26 11:48:29 America/Los_Angeles * add 'builder => sub { ... }' shortcut [gh #4] 0.014 2012-08-16 17:26:09 America/Los_Angeles * explictly test for definedness rather than truthiness when determining if someone has also specified a default along with is => lazy 0.013 2012-07-15 22:11:37 America/Los_Angeles * Restore tests lost from (d11e67a) -- no functional / code changes! 0.012 2012-05-02 11:02:10 America/Los_Angeles * TRIAL/dev release * Don't try to guess what sort of metaclass we need; just die if we don't have one * Misc cleanups 0.011 2012-04-30 13:41:05 America/Los_Angeles * TRIAL/dev release * Handle the no-metaclass case in our init_meta() 0.010 2012-04-06 18:25:42 America/Los_Angeles * Minor doc updates; no functional changes from 0.009 (TRIAL) 0.009 2012-03-26 23:46:58 America/Los_Angeles * Drop 'init_arg => undef' from our 'ro => "lazy"' shortcut. This was done in coordination with the author of Moo, based on consistently surprised user feedback. 0.008 2012-01-10 23:05:34 America/Los_Angeles * Prebuild our roles, for better caching (and fewer warnings, at least) 0.007 2012-01-10 17:30:57 America/Los_Angeles * Allow default to be also be specified when is => lazy 0.006 2011-10-27 10:15:07 America/Los_Angeles * We now handle "trigger => 1", as well * All our tests are wrapped in Test::Moose::with_immutable(), just to make sure that we immutablize properly 0.005 2011-08-18 20:54:02 America/Los_Angeles * handle attribute extension/cloning, for realz this time * we now handle the case of attributes defined in roles by properly applying our trait to the applied_attribute metaclass 0.004 2011-08-02 23:44:20 America/Los_Angeles * add lazy_build => 'private' * our laziness was being ignored when an attribute defined in one class was being extended/cloned in another class -- this could not stand 0.003 2011-07-03 16:40:19 America/Los_Angeles * handle predicate => 1, clearer => 1 as well 0.002 2011-03-30 23:43:11 America/Los_Angeles * Convert our trait to a parameterized role, to allow for different build and writer prefixes (e.g. '_set_' vs '_') * Cause 'is => "lazy"' to behave the way it does in Moo * Change the default writer prefix from _ to _set_; it was pointed out that this is the expected way to do things (and makes more sense, really). 0.001 2011-03-27 08:12:11 America/Los_Angeles * initial release MooseX-AttributeShortcuts-0.037/README0000644000175100017510000003542313204655723017371 0ustar maxmindmaxmindNAME MooseX::AttributeShortcuts - Shorthand for common attribute options VERSION This document describes version 0.037 of MooseX::AttributeShortcuts - released November 20, 2017 as part of MooseX-AttributeShortcuts. SYNOPSIS package Some::Class; use Moose; use MooseX::AttributeShortcuts; # same as: # is => 'ro', lazy => 1, builder => '_build_foo' has foo => (is => 'lazy'); # same as: is => 'ro', writer => '_set_foo' has foo => (is => 'rwp'); # same as: is => 'ro', builder => '_build_bar' has bar => (is => 'ro', builder => 1); # same as: is => 'ro', clearer => 'clear_bar' has bar => (is => 'ro', clearer => 1); # same as: is => 'ro', predicate => 'has_bar' has bar => (is => 'ro', predicate => 1); # works as you'd expect for "private": predicate => '_has_bar' has _bar => (is => 'ro', predicate => 1); # extending? Use the "Shortcuts" trait alias extends 'Some::OtherClass'; has '+bar' => (traits => [Shortcuts], builder => 1, ...); DESCRIPTION Ever find yourself repeatedly specifying writers and builders, because there's no good shortcut to specifying them? Sometimes you want an attribute to have a read-only public interface, but a private writer. And wouldn't it be easier to just say builder => 1 and have the attribute construct the canonical _build_$name builder name for you? This package causes an attribute trait to be applied to all attributes defined to the using class. This trait extends the attribute option processing to handle the above variations. All attribute options as described in Moose or Class::MOP::Attribute remain usable, just as when this trait is not applied. Some Notes On History Moose has long had a lazy_build attribute option. It was once considered a best practice, but that has, ah, changed. This trait began as a desire to still leverage bits of lazy_build (and a tacit acknowledgment that fat-finger bugs rank among the most embarrassing, right up there with "the TV was unplugged the entire time"). This author does not recommend you use lazy_build, unless you know exactly what you're doing (probably) and that it's a good idea (probably not). Nonetheless, this lazy_build option is why we set certain options the way we do below; while lazy_build in its entirety is not optimal, it had the right idea: regular, predictable accessor names for regular, predictable attribute options. As an example, just looking at the below it doesn't seem logical that: has _foo => (is => 'ro', clearer => 1); ...becomes: has _foo => (is => 'ro', clearer => '_clear_foo'); After reading the lazy_build attribute option, however, we see that the choice had already been made for us. USAGE This package automatically applies an attribute metaclass trait. Simply using this package causes the trait to be applied by default to your attribute's metaclasses. EXTENDING A CLASS If you're extending a class and trying to extend its attributes as well, you'll find out that the trait is only applied to attributes defined locally in the class. This package exports a trait shortcut function Shortcuts that will help you apply this to the extended attribute: has '+something' => (traits => [Shortcuts], ...); NEW ATTRIBUTE OPTIONS Unless specified here, all options defined by Moose::Meta::Attribute and Class::MOP::Attribute remain unchanged. Want to see additional options? Ask, or better yet, fork on GitHub and send a pull request. If the shortcuts you're asking for already exist in Moo or Mouse or elsewhere, please note that as it will carry significant weight. For the following, $name should be read as the attribute name; and the various prefixes should be read using the defaults. is => 'rwp' Specifying is => 'rwp' will cause the following options to be set: is => 'ro' writer => "_set_$name" rwp can be read as "read + write private". is => 'lazy' Specifying is => 'lazy' will cause the following options to be set: is => 'ro' builder => "_build_$name" lazy => 1 NOTE: Since 0.009 we no longer set init_arg => undef if no init_arg is explicitly provided. This is a change made in parallel with Moo, based on a large number of people surprised that lazy also made one's init_def undefined. is => 'lazy', default => ... Specifying is => 'lazy' and a default will cause the following options to be set: is => 'ro' lazy => 1 default => ... # as provided That is, if you specify is => 'lazy' and also provide a default, then we won't try to set a builder, as well. builder => 1 Specifying builder => 1 will cause the following options to be set: builder => "_build_$name" builder => sub { ... } Passing a coderef to builder will cause that coderef to be installed in the class this attribute is associated with the name you'd expect, and builder => 1 to be set. e.g., in your class (or role), has foo => (is => 'ro', builder => sub { 'bar!' }); ...is effectively the same as... has foo => (is => 'ro', builder => '_build_foo'); sub _build_foo { 'bar!' } The behaviour of this option in roles changed in 0.030, and the builder methods will be installed in the role itself. This means you can alias/exclude/etc builder methods in roles, just as you can with any other method. clearer => 1 Specifying clearer => 1 will cause the following options to be set: clearer => "clear_$name" or, if your attribute name begins with an underscore: clearer => "_clear$name" (that is, an attribute named _foo would get _clear_foo) predicate => 1 Specifying predicate => 1 will cause the following options to be set: predicate => "has_$name" or, if your attribute name begins with an underscore: predicate => "_has$name" (that is, an attribute named _foo would get _has_foo) init_arg => 1 / -1 This is a somewhat esoteric shortcut; you probably don't want to use this (or even read this section). Specifying init_arg => 1 will cause the following options to be set: # attribute: "name" init_arg => 'name' # or, attribute: "_name" init_arg => '_name' ...while init_arg => -1 will cause the following options to be set: # attribute: "name" init_arg => '_name' # or, attribute: "_name" init_arg => 'name' trigger => 1 Specifying trigger => 1 will cause the attribute to be created with a trigger that calls a named method in the class with the options passed to the trigger. By default, the method name the trigger calls is the name of the attribute prefixed with _trigger_. e.g., for an attribute named foo this would be equivalent to: trigger => sub { shift->_trigger_foo(@_) } For an attribute named _foo: trigger => sub { shift->_trigger__foo(@_) } This naming scheme, in which the trigger is always private, is the same as the builder naming scheme (just with a different prefix). handles => { foo => sub { ... }, ... } Creating a delegation with a coderef will now create a new, "custom accessor" for the attribute. These coderefs will be installed and called as methods on the associated class (just as readers, writers, and other accessors are), and will have the attribute metaclass available in $_. Anything the accessor is called with it will have access to in @_, just as you'd expect of a method. e.g., the following example creates an attribute named bar with a standard reader accessor named bar and two custom accessors named foo and foo_too. has bar => ( is => 'ro', isa => 'Int', handles => { foo => sub { my $self = shift @_; return $_->get_value($self) + 1; }, foo_too => sub { my $self = shift @_; return $self->bar + 1; }, # ...as you'd expect. bar => 'bar', }, ); ...and later, Note that in this example both foo() and foo_too() do effectively the same thing: return the attribute's current value plus 1. However, foo() accesses the attribute value directly through the metaclass, the pros and cons of which this author leaves as an exercise for the reader to determine. You may choose to use the installed accessors to get at the attribute's value, or use the direct metaclass access, your choice. ANONYMOUS SUBTYPING AND COERCION "Abusus non tollit usum." Note that we create new, anonymous subtypes whenever the constraint or coercion options are specified in such a way that the Shortcuts trait (this one) is invoked. It's fully supported to use both constraint and coerce options at the same time. This facility is intended to assist with the creation of one-off type constraints and coercions. It is not possible to deliberately reuse the subtypes we create, and if you find yourself using a particular isa / constraint / coerce option triplet in more than one place you should really think about creating a type that you can reuse. MooseX::Types provides the facilities to easily do this, or even a simple constant definition at the package level with an anonymous type stashed away for local use. isa => sub { ... } has foo => ( is => 'rw', # $_ == $_[0] == the value to be validated isa => sub { die unless $_[0] == 1 }, ); # passes constraint $thing->foo(1); # fails constraint $thing->foo(5); Given a coderef, create a type constraint for the attribute. This constraint will fail if the coderef dies, and pass otherwise. Astute users will note that this is the same way Moo constraints work; we use MooseX::Meta::TypeConstraint::Mooish to implement the constraint. isa_instance_of => ... Given a package name, this option will create an isa type constraint that requires the value of the attribute be an instance of the class (or a descendant class) given. That is, has foo => (is => 'ro', isa_instance_of => 'SomeThing'); ...is effectively the same as: use Moose::TypeConstraints 'class_type'; has foo => ( is => 'ro', isa => class_type('SomeThing'), ); ...but a touch less awkward. isa => ..., constraint => sub { ... } Specifying the constraint option with a coderef will cause a new subtype constraint to be created, with the parent type being the type specified in the isa option and the constraint being the coderef supplied here. For example, only integers greater than 10 will pass this attribute's type constraint: # value must be an integer greater than 10 to pass the constraint has thinger => ( isa => 'Int', constraint => sub { $_ > 10 }, # ... ); Note that if you supply a constraint, you must also provide an isa. isa => ..., constraint => sub { ... }, coerce => 1 Supplying a constraint and asking for coercion will "Just Work", that is, any coercions that the isa type has will still work. For example, let's say that you're using the File type constraint from MooseX::Types::Path::Class, and you want an additional constraint that the file must exist: has thinger => ( is => 'ro', isa => File, constraint => sub { !! $_->stat }, coerce => 1, ); thinger will correctly coerce the string "/etc/passwd" to a Path::Class:File, and will only accept the coerced result as a value if the file exists. coerce => [ Type => sub { ...coerce... }, ... ] Specifying the coerce option with a hashref will cause a new subtype to be created and used (just as with the constraint option, above), with the specified coercions added to the list. In the passed hashref, the keys are Moose types (well, strings resolvable to Moose types), and the values are coderefs that will coerce a given type to our type. has bar => ( is => 'ro', isa => 'Str', coerce => [ Int => sub { "$_" }, Object => sub { 'An instance of ' . ref $_ }, ], ); INTERACTIONS WITH OTHER ATTRIBUTE TRAITS Sometimes attribute traits interact in surprising ways. This trait is well behaved; if you have discovered any interactions with other traits (good, bad, indifferent, etc), please report this so that it can be worked around, fixed, or documented, as appropriate. MooseX::SemiAffordanceAccessor MooseX::SemiAffordanceAccessor changes how the is => 'rw' and accessor => ... attribute options work. If our trait detects that an attribute has had the MooseX::SemiAffordanceAccessor attribute trait applied, then we change our behaviour to conform to its expectations: * is => 'rwp' This: has foo => (is => 'rwp'); has _bar => (is => 'rwp'); ...is now effectively equivalent to: has foo => (is => 'ro', writer => '_set_foo'); has _bar => (is => 'ro', writer => '_set_bar') * -writer_prefix is ignored ...as MooseX::SemiAffordanceAccessor has its own specific ideas as to how writers should look. SEE ALSO Please see those modules/websites for more information related to this module. * Moo * MooseX::Types * MooseX::SemiAffordanceAccessor BUGS Please report any bugs or feature requests on the bugtracker website https://github.com/RsrchBoy/moosex-attributeshortcuts/issues When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. AUTHOR Chris Weyl CONTRIBUTORS * David Steinbrunner * Graham Knop * Karen Etheridge * Olaf Alders COPYRIGHT AND LICENSE This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999