pax_global_header00006660000000000000000000000064134774502170014524gustar00rootroot0000000000000052 comment=acf566afdfede8b5bb8e8718de89f5777eec9d1b libmoox-shorthas-perl-1.190320/000077500000000000000000000000001347745021700162255ustar00rootroot00000000000000libmoox-shorthas-perl-1.190320/Changes000066400000000000000000000012071347745021700175200ustar00rootroot00000000000000Revision history for MooX-ShortHas 1.190320 2019-02-01 22:09:00+01:00 Europe/Berlin - add Mus to the SEE ALSO section 1.172300 2017-08-18 16:04:56+02:00 Europe/Berlin - added a third recognized form of "this is ro" to tests 1.172251 2017-08-13 15:51:39+02:00 Europe/Berlin - tests now accept various Moo error message styles 1.172250 2017-08-13 15:41:36+02:00 Europe/Berlin - throw error when attempting use in a non-Mooish class - prevent $caller from being parsed wrongly 1.172231 2017-08-11 15:20:49+02:00 Europe/Berlin - some docs polish 1.172230 2017-08-11 14:09:32+02:00 Europe/Berlin - first release libmoox-shorthas-perl-1.190320/LICENSE000066400000000000000000000164051347745021700172400ustar00rootroot00000000000000 Christian Walde has dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law. Works under CC0 do not require attribution. When citing the work, you should not imply endorsement by the author. Creative Commons Legal Code CC0 1.0 Universal CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER. Statement of Purpose The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others. For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. 1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following: i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; ii. moral rights retained by the original author(s) and/or performer(s); iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; v. rights protecting the extraction, dissemination, use and reuse of data in a Work; vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); vii. and other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. 2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose. 3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose. 4. Limitations and Disclaimers. a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. libmoox-shorthas-perl-1.190320/MANIFEST000066400000000000000000000006151347745021700173600ustar00rootroot00000000000000# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README README.PATCHING cpanfile dist.ini lib/MooX/ShortHas.pm perlcritic.rc t/00-compile.t t/basic.t xt/author/critic.t xt/author/pod-coverage.t xt/author/pod-syntax.t xt/author/portability.t xt/author/test-version.t xt/release/distmeta.t libmoox-shorthas-perl-1.190320/META.json000066400000000000000000000047501347745021700176540ustar00rootroot00000000000000{ "abstract" : "shortcuts for common Moo has attribute configurations", "author" : [ "Christian Walde " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010", "license" : [ "unrestricted" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "MooX-ShortHas", "no_index" : { "directory" : [ "corpus", "examples", "t", "xt" ], "package" : [ "DB" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "perl" : "5.006" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Meta" : "0", "Test::More" : "0", "Test::Perl::Critic" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Portability::Files" : "0", "Test::Version" : "1", "strict" : "0", "warnings" : "0" } }, "runtime" : { "requires" : { "Moo::_Utils" : "0", "perl" : "5.006", "strictures" : "2" } }, "test" : { "requires" : { "File::Spec" : "0", "File::Temp" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Moo" : "0", "Test::Fatal" : "0", "Test::InDistDir" : "0", "Test::More" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" } } }, "provides" : { "MooX::ShortHas" : { "file" : "lib/MooX/ShortHas.pm", "version" : "1.190320" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/wchristian/MooX-ShortHas/issues" }, "homepage" : "https://github.com/wchristian/MooX-ShortHas", "repository" : { "type" : "git", "url" : "https://github.com/wchristian/MooX-ShortHas.git", "web" : "https://github.com/wchristian/MooX-ShortHas" } }, "version" : "1.190320", "x_contributors" : [ "mst - Matt S. Trout (cpan:MSTROUT) " ], "x_generated_by_perl" : "v5.28.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.02" } libmoox-shorthas-perl-1.190320/META.yml000066400000000000000000000023241347745021700174770ustar00rootroot00000000000000--- abstract: 'shortcuts for common Moo has attribute configurations' author: - 'Christian Walde ' build_requires: File::Spec: '0' File::Temp: '0' IO::Handle: '0' IPC::Open3: '0' Moo: '0' Test::Fatal: '0' Test::InDistDir: '0' Test::More: '0' perl: '5.006' strict: '0' warnings: '0' configure_requires: ExtUtils::MakeMaker: '0' perl: '5.006' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010' license: unrestricted meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: MooX-ShortHas no_index: directory: - corpus - examples - t - xt package: - DB provides: MooX::ShortHas: file: lib/MooX/ShortHas.pm version: '1.190320' requires: Moo::_Utils: '0' perl: '5.006' strictures: '2' resources: bugtracker: https://github.com/wchristian/MooX-ShortHas/issues homepage: https://github.com/wchristian/MooX-ShortHas repository: https://github.com/wchristian/MooX-ShortHas.git version: '1.190320' x_contributors: - 'mst - Matt S. Trout (cpan:MSTROUT) ' x_generated_by_perl: v5.28.0 x_serialization_backend: 'YAML::Tiny version 1.73' libmoox-shorthas-perl-1.190320/Makefile.PL000066400000000000000000000027431347745021700202050ustar00rootroot00000000000000# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "shortcuts for common Moo has attribute configurations", "AUTHOR" => "Christian Walde ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "MooX-ShortHas", "LICENSE" => "unrestricted", "MIN_PERL_VERSION" => "5.006", "NAME" => "MooX::ShortHas", "PREREQ_PM" => { "Moo::_Utils" => 0, "strictures" => 2 }, "TEST_REQUIRES" => { "File::Spec" => 0, "File::Temp" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Moo" => 0, "Test::Fatal" => 0, "Test::InDistDir" => 0, "Test::More" => 0, "strict" => 0, "warnings" => 0 }, "VERSION" => "1.190320", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "File::Spec" => 0, "File::Temp" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Moo" => 0, "Moo::_Utils" => 0, "Test::Fatal" => 0, "Test::InDistDir" => 0, "Test::More" => 0, "strict" => 0, "strictures" => 2, "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); libmoox-shorthas-perl-1.190320/README000066400000000000000000000056241347745021700171140ustar00rootroot00000000000000NAME MooX::ShortHas - shortcuts for common Moo has attribute configurations VERSION version 1.190320 SYNOPSIS Instead of: use Moo; has hro => is => ro => required => 1; has hlazy => is => lazy => builder => sub { 2 }; has hrwp => is => rwp => required => 1; has hrw => is => rw => required => 1; You can now write: use Moo; use MooX::ShortHas; ro "hro"; lazy hlazy => sub { 2 }; rwp "hrwp"; rw "hrw"; And options can be added or overriden by appending them: ro hro_opt => required => 0; DESCRIPTION Moo's has asks developers to repeat themselves a lot to set up attributes, and since its inceptions the most common configurations of attributes have crystallized through long usage. This module provides sugar shortcuts that wrap around has under the appropriate names to reduce the effort of setting up an attribute to naming it with a shortcut. EXPORTS ro, rwp, rw These three work the same, they convert a call like this: ro $name => @extra_args; To this corresponding has call: has $name => is => ro => required => 1 => @extra_args; The appending of extra args makes it easy to override the required if necessary. lazy This one is slightly different than the others, as lazy arguments don't require a constructor value, but almost always want a builder of some kind: lazy $name => @extra_args; Corresponds to: has $name => is => lazy => builder => @extra_args; The first extra argument is thus expected to be any of the values appropriate for the builder option. SEE ALSO * Mu - automatically wraps this module into Moo * Mu::Role - automatically wraps this module into Moo::Role * Mus - Mu but with slightly more typing and strict constructors SUPPORT Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at https://github.com/wchristian/MooX-ShortHas/issues. You will be notified automatically of any progress on your issue. Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. https://github.com/wchristian/MooX-ShortHas git clone https://github.com/wchristian/MooX-ShortHas.git AUTHOR Christian Walde CONTRIBUTOR mst - Matt S. Trout (cpan:MSTROUT) COPYRIGHT AND LICENSE Christian Walde has dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law. Works under CC0 do not require attribution. When citing the work, you should not imply endorsement by the author. libmoox-shorthas-perl-1.190320/README.PATCHING000066400000000000000000000032601347745021700203020ustar00rootroot00000000000000README.PATCHING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. The distribution is managed with Dist::Zilla. This means than many of the usual files you might expect are not in the repository, but are generated at release time (e.g. Makefile.PL). However, you can run tests directly using the 'prove' tool: $ prove -l $ prove -lv t/some_test_file.t For most distributions, 'prove' is entirely sufficent for you to test any patches you have. You may need to satisfy some dependencies. See the included META.json file for a list. If you install App::mymeta_requires from CPAN, it's easy to satisfy any that you are missing by piping the output to your favorite CPAN client: $ mymeta-requires | cpanm $ cpan `mymeta-requires` Likewise, much of the documentation Pod is generated at release time. Depending on the distribution, some documentation may be written in a Pod dialect called WikiDoc. (See Pod::WikiDoc on CPAN.) If you would like to submit a documentation edit, please limit yourself to the documentation you see. If you see typos or documentation issues in the generated docs, please email or open a bug ticket instead of patching. Dist::Zilla is a very powerful authoring tool, but requires a number of author-specific plugins. If you would like to use it for contributing, install it from CPAN, then run one of the following commands, depending on your CPAN client: $ cpan `dzil authordeps` $ dzil authordeps | cpanm Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil xtest You can learn more about Dist::Zilla at http://dzil.org/ libmoox-shorthas-perl-1.190320/cpanfile000066400000000000000000000016701347745021700177350ustar00rootroot00000000000000requires "Moo::_Utils" => "0"; requires "perl" => "5.006"; requires "strictures" => "2"; on 'test' => sub { requires "File::Spec" => "0"; requires "File::Temp" => "0"; requires "IO::Handle" => "0"; requires "IPC::Open3" => "0"; requires "Moo" => "0"; requires "Test::Fatal" => "0"; requires "Test::InDistDir" => "0"; requires "Test::More" => "0"; requires "perl" => "5.006"; requires "strict" => "0"; requires "warnings" => "0"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "0"; requires "perl" => "5.006"; }; on 'develop' => sub { requires "Pod::Coverage::TrustPod" => "0"; requires "Test::CPAN::Meta" => "0"; requires "Test::More" => "0"; requires "Test::Perl::Critic" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; requires "Test::Portability::Files" => "0"; requires "Test::Version" => "1"; requires "strict" => "0"; requires "warnings" => "0"; }; libmoox-shorthas-perl-1.190320/dist.ini000066400000000000000000000004571347745021700176770ustar00rootroot00000000000000name = MooX-ShortHas author = Christian Walde copyright_holder = Christian Walde copyright_year = 2017 license = CC0_1_0 [@MITHALDU] [Meta::Contributors] contributor = mst - Matt S. Trout (cpan:MSTROUT) libmoox-shorthas-perl-1.190320/lib/000077500000000000000000000000001347745021700167735ustar00rootroot00000000000000libmoox-shorthas-perl-1.190320/lib/MooX/000077500000000000000000000000001347745021700176555ustar00rootroot00000000000000libmoox-shorthas-perl-1.190320/lib/MooX/ShortHas.pm000066400000000000000000000101171347745021700217460ustar00rootroot00000000000000package MooX::ShortHas; use strictures 2; our $VERSION = '1.190320'; # VERSION # ABSTRACT: shortcuts for common Moo has attribute configurations # # This file is part of MooX-ShortHas # # # Christian Walde has dedicated the work to the Commons by waiving all of his # or her rights to the work worldwide under copyright law and all related or # neighboring legal rights he or she had in the work, to the extent allowable by # law. # # Works under CC0 do not require attribution. When citing the work, you should # not imply endorsement by the author. # use Moo::_Utils; sub _modified_has { my ( $has, $mod, $name, @args ) = @_; $has->( $name, @{$mod}, @args ); } sub import { my $caller = caller; my $has = $caller->can( "has" ) or die "Moo not loaded in caller: $caller"; my %mods = ( lazy => [qw( is lazy builder )], map { $_ => [ is => $_ => required => 1 ] } qw( ro rwp rw ) ); for my $mod ( keys %mods ) { _install_coderef $caller. "::$mod" => sub { _modified_has $has, $mods{$mod}, @_; }; } } 1; __END__ =pod =head1 NAME MooX::ShortHas - shortcuts for common Moo has attribute configurations =head1 VERSION version 1.190320 =head1 SYNOPSIS Instead of: use Moo; has hro => is => ro => required => 1; has hlazy => is => lazy => builder => sub { 2 }; has hrwp => is => rwp => required => 1; has hrw => is => rw => required => 1; You can now write: use Moo; use MooX::ShortHas; ro "hro"; lazy hlazy => sub { 2 }; rwp "hrwp"; rw "hrw"; And options can be added or overriden by appending them: ro hro_opt => required => 0; =head1 DESCRIPTION L's C asks developers to repeat themselves a lot to set up attributes, and since its inceptions the most common configurations of attributes have crystallized through long usage. This module provides sugar shortcuts that wrap around has under the appropriate names to reduce the effort of setting up an attribute to naming it with a shortcut. =head1 EXPORTS =head2 ro, rwp, rw These three work the same, they convert a call like this: ro $name => @extra_args; To this corresponding has call: has $name => is => ro => required => 1 => @extra_args; The appending of extra args makes it easy to override the required if necessary. =head2 lazy This one is slightly different than the others, as lazy arguments don't require a constructor value, but almost always want a builder of some kind: lazy $name => @extra_args; Corresponds to: has $name => is => lazy => builder => @extra_args; The first extra argument is thus expected to be any of the values appropriate for the builder option. =head1 SEE ALSO =over =item * L - automatically wraps this module into Moo =item * L - automatically wraps this module into Moo::Role =item * L - Mu but with slightly more typing and strict constructors =back =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT =head2 Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at L. You will be notified automatically of any progress on your issue. =head2 Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. L git clone https://github.com/wchristian/MooX-ShortHas.git =head1 AUTHOR Christian Walde =head1 CONTRIBUTOR =for stopwords mst - Matt S. Trout (cpan:MSTROUT) mst - Matt S. Trout (cpan:MSTROUT) =head1 COPYRIGHT AND LICENSE Christian Walde has dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law. Works under CC0 do not require attribution. When citing the work, you should not imply endorsement by the author. =cut libmoox-shorthas-perl-1.190320/perlcritic.rc000066400000000000000000000004731347745021700207170ustar00rootroot00000000000000# THIS IS AN AUTOMATICALLY GENERATED FILE. # CHANGES TO IT WILL BE DESTROYED BY Dist::Zilla. [TestingAndDebugging::RequireUseStrict] equivalent_modules = strictures [-OTRS::RequireCamelCase] [-OTRS::RequireParensWithMethods] [-ValuesAndExpressions::ProhibitAccessOfPrivateData] [-OTRS::ProhibitLowPrecedenceOps] libmoox-shorthas-perl-1.190320/t/000077500000000000000000000000001347745021700164705ustar00rootroot00000000000000libmoox-shorthas-perl-1.190320/t/00-compile.t000066400000000000000000000027531347745021700205310ustar00rootroot00000000000000use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More; plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'MooX/ShortHas.pm' ); # fake home for cpan-testers use File::Temp; local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 ); 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}; libmoox-shorthas-perl-1.190320/t/basic.t000066400000000000000000000031601347745021700177360ustar00rootroot00000000000000use strictures 2; use Test::InDistDir; use Test::More; use Test::Fatal; BEGIN { package Thing; use Moo; use MooX::ShortHas; ro "hro"; lazy hlazy => sub { 2 } => predicate => 1; rwp "hrwp"; rw "hrw"; ro hro_opt => required => 0; } run(); done_testing; exit; sub run { Thing->can( "rw" )->( "hrw_dyn" ); my $self = Thing->new( qw( hro 2 hrwp 3 hrw 3 hrw_dyn 3 ) ); is $self->hro_opt, undef, "hro_opt works but did not cause blow-up on construction"; my $ro_qr = qr/Usage: Class::XSAccessor::getter\(self\)|Usage: Thing::\w+\(self\)|\w+ is a read-only accessor/; like exception { $self->hro( 2 ) }, $ro_qr, "hro is ro"; like exception { $self->_set_hro( 2 ) }, qr/Can't locate object method "_set_hro" via package "Thing"/, "hro has no setter"; is $self->hro, 2, "hro as getter works"; is $self->has_hlazy, "", "hlazy builder not yet called"; is $self->hlazy, 2, "hlazy returns correct value"; is $self->hrwp, 3, "hrwp initial state correct"; like exception { $self->hrwp( 2 ) }, $ro_qr, "hrwp is ro"; $self->_set_hrwp( 2 ); is $self->hrwp, 2, "hrwp setter worked"; is $self->hrw, 3, "hrw initial state correct"; $self->hrw( 2 ); is $self->hrw, 2, "hrw as setter worked"; is $self->hrw_dyn, 3, "hrw_dyn initial state correct"; $self->hrw_dyn( 2 ); is $self->hrw, 2, "hrw_dyn installation worked"; { package Nothing; use Test::More; use Test::Fatal; like exception { MooX::ShortHas->import }, qr/Moo not loaded in caller: Nothing/, "require Moo to be loaded"; } return; } libmoox-shorthas-perl-1.190320/xt/000077500000000000000000000000001347745021700166605ustar00rootroot00000000000000libmoox-shorthas-perl-1.190320/xt/author/000077500000000000000000000000001347745021700201625ustar00rootroot00000000000000libmoox-shorthas-perl-1.190320/xt/author/critic.t000066400000000000000000000002011347745021700216150ustar00rootroot00000000000000#!perl use strict; use warnings; use Test::Perl::Critic (-profile => "perlcritic.rc") x!! -e "perlcritic.rc"; all_critic_ok(); libmoox-shorthas-perl-1.190320/xt/author/pod-coverage.t000066400000000000000000000003341347745021700227220ustar00rootroot00000000000000#!perl # 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' }); libmoox-shorthas-perl-1.190320/xt/author/pod-syntax.t000066400000000000000000000002521347745021700224540ustar00rootroot00000000000000#!perl # 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(); libmoox-shorthas-perl-1.190320/xt/author/portability.t000066400000000000000000000002671347745021700227160ustar00rootroot00000000000000use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); libmoox-shorthas-perl-1.190320/xt/author/test-version.t000066400000000000000000000006371347745021700230170ustar00rootroot00000000000000use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); my $params = { is_strict => 0, has_version => 1, multiple => 0, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; libmoox-shorthas-perl-1.190320/xt/release/000077500000000000000000000000001347745021700203005ustar00rootroot00000000000000libmoox-shorthas-perl-1.190320/xt/release/distmeta.t000066400000000000000000000001721347745021700222770ustar00rootroot00000000000000#!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok();