MooseX-StrictConstructor-0.19/0000755000175000017500000000000011705366560016242 5ustar autarchautarchMooseX-StrictConstructor-0.19/MANIFEST0000644000175000017500000000060711705366560017376 0ustar autarchautarchChanges INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/MooseX/StrictConstructor.pm lib/MooseX/StrictConstructor/Trait/Class.pm lib/MooseX/StrictConstructor/Trait/Method/Constructor.pm t/basic.t t/instance.t t/release-cpan-changes.t t/release-eol.t t/release-no-tabs.t t/release-pod-linkcheck.t t/release-pod-no404s.t t/release-pod-spell.t t/release-pod-syntax.t MooseX-StrictConstructor-0.19/t/0000755000175000017500000000000011705366560016505 5ustar autarchautarchMooseX-StrictConstructor-0.19/t/release-pod-spell.t0000644000175000017500000000132211705366560022205 0ustar autarchautarch BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; eval "use Test::Spelling"; plan skip_all => "Test::Spelling required for testing POD coverage" if $@; my @stopwords; for () { chomp; push @stopwords, $_ unless /\A (?: \# | \s* \z)/msx; # skip comments, whitespace } add_stopwords(@stopwords); set_spell_cmd('aspell list -l en'); # This prevents a weird segfault from the aspell command - see # https://bugs.launchpad.net/ubuntu/+source/aspell/+bug/71322 local $ENV{LC_ALL} = 'C'; all_pod_files_spelling_ok(); __DATA__ PayPal Rolsky init MooseX-StrictConstructor-0.19/t/release-no-tabs.t0000644000175000017500000000045011705366560021652 0ustar autarchautarch BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; eval 'use Test::NoTabs'; plan skip_all => 'Test::NoTabs required' if $@; all_perl_files_ok(); MooseX-StrictConstructor-0.19/t/basic.t0000644000175000017500000000672611705366560017766 0ustar autarchautarchuse strict; use warnings; use Test::Fatal; use Test::Moose qw( with_immutable ); use Test::More 0.88; { package Standard; use Moose; has 'thing' => ( is => 'rw' ); } { package Stricter; use Moose; use MooseX::StrictConstructor; has 'thing' => ( is => 'rw' ); } { package Subclass; use Moose; use MooseX::StrictConstructor; extends 'Stricter'; has 'size' => ( is => 'rw' ); } { package StrictSubclass; use Moose; extends 'Stricter'; has 'size' => ( is => 'rw' ); } { package OtherStrictSubclass; use Moose; use MooseX::StrictConstructor; extends 'Standard'; has 'size' => ( is => 'rw' ); } { package Tricky; use Moose; use MooseX::StrictConstructor; has 'thing' => ( is => 'rw' ); sub BUILD { my $self = shift; my $params = shift; delete $params->{spy}; } } { package InitArg; use Moose; use MooseX::StrictConstructor; has 'thing' => ( is => 'rw', 'init_arg' => 'other' ); has 'size' => ( is => 'rw', 'init_arg' => undef ); } my @classes = qw( Standard Stricter Subclass StrictSubclass OtherStrictSubclass Tricky InitArg ); with_immutable { is( exception { Standard->new( thing => 1, bad => 99 ) }, undef, 'standard Moose class ignores unknown params' ); like( exception { Stricter->new( thing => 1, bad => 99 ) }, qr/unknown attribute.+: bad/, 'strict constructor blows up on unknown params' ); is( exception { Subclass->new( thing => 1, size => 'large' ) }, undef, 'subclass constructor handles known attributes correctly' ); like( exception { Subclass->new( thing => 1, bad => 99 ) }, qr/unknown attribute.+: bad/, 'subclass correctly recognizes bad attribute' ); is( exception { StrictSubclass->new( thing => 1, size => 'large', ) }, undef, q{subclass that doesn't use strict constructor handles known attributes correctly} ); like( exception { StrictSubclass->new( thing => 1, bad => 99 ) }, qr/unknown attribute.+: bad/, q{subclass that doesn't use strict correctly recognizes bad attribute} ); is( exception { OtherStrictSubclass->new( thing => 1, size => 'large', ) }, undef, q{strict subclass from parent that doesn't use strict constructor handles known attributes correctly} ); like( exception { OtherStrictSubclass->new( thing => 1, bad => 99 ) }, qr/unknown attribute.+: bad/, q{strict subclass from parent that doesn't use strict correctly recognizes bad attribute} ); is( exception { Tricky->new( thing => 1, spy => 99 ) }, undef, 'can work around strict constructor by deleting params in BUILD()' ); like( exception { Tricky->new( thing => 1, agent => 99 ) }, qr/unknown attribute.+: agent/, 'Tricky still blows up on unknown params other than spy' ); like( exception { InitArg->new( thing => 1 ) }, qr/unknown attribute.+: thing/, 'InitArg blows up with attribute name' ); like( exception { InitArg->new( size => 1 ) }, qr/unknown attribute.+: size/, 'InitArg blows up when given attribute with undef init_arg' ); is( exception { InitArg->new( other => 1 ) }, undef, 'InitArg works when given proper init_arg' ); } @classes; done_testing(); MooseX-StrictConstructor-0.19/t/instance.t0000644000175000017500000000101711705366560020475 0ustar autarchautarchuse strict; use warnings; use Test::More; use Test::Moose qw( with_immutable ); use Test::Fatal; { package Foo; use Moose; use MooseX::StrictConstructor; } with_immutable { is( exception { Foo->new( __INSTANCE__ => Foo->new ) }, undef, '__INSTANCE__ is ignored when passed to ->new', ); is( exception { Foo->meta->new_object( __INSTANCE__ => Foo->new ) }, undef, '__INSTANCE__ is ignored when passed to ->new_object', ); } 'Foo'; done_testing(); MooseX-StrictConstructor-0.19/t/release-pod-linkcheck.t0000644000175000017500000000077511705366560023034 0ustar autarchautarch#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } 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-StrictConstructor-0.19/t/release-eol.t0000644000175000017500000000047611705366560021076 0ustar autarchautarch BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; eval 'use Test::EOL'; plan skip_all => 'Test::EOL required' if $@; all_perl_files_ok({ trailing_whitespace => 1 }); MooseX-StrictConstructor-0.19/t/release-pod-syntax.t0000644000175000017500000000045011705366560022415 0ustar autarchautarch#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); MooseX-StrictConstructor-0.19/t/release-pod-no404s.t0000644000175000017500000000076511705366560022127 0ustar autarchautarch#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_NO404S AUTOMATED_TESTING ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::No404s"; if ( $@ ) { plan skip_all => 'Test::Pod::No404s required for testing POD'; } else { all_pod_files_ok(); } MooseX-StrictConstructor-0.19/t/release-cpan-changes.t0000644000175000017500000000047111705366560022641 0ustar autarchautarch#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval 'use Test::CPAN::Changes'; plan skip_all => 'Test::CPAN::Changes required for this test' if $@; changes_ok(); done_testing(); MooseX-StrictConstructor-0.19/lib/0000755000175000017500000000000011705366560017010 5ustar autarchautarchMooseX-StrictConstructor-0.19/lib/MooseX/0000755000175000017500000000000011705366560020222 5ustar autarchautarchMooseX-StrictConstructor-0.19/lib/MooseX/StrictConstructor.pm0000644000175000017500000000455011705366560024302 0ustar autarchautarchpackage MooseX::StrictConstructor; { $MooseX::StrictConstructor::VERSION = '0.19'; } use strict; use warnings; use Moose 0.94 (); use Moose::Exporter; use Moose::Util::MetaRole; use MooseX::StrictConstructor::Trait::Class; use MooseX::StrictConstructor::Trait::Method::Constructor;; my %metaroles = ( class => ['MooseX::StrictConstructor::Trait::Class'], ); $metaroles{constructor} = ['MooseX::StrictConstructor::Trait::Method::Constructor'] if $Moose::VERSION <= 1.9900; Moose::Exporter->setup_import_methods( class_metaroles => \%metaroles ); 1; # ABSTRACT: Make your object constructors blow up on unknown attributes =pod =head1 NAME MooseX::StrictConstructor - Make your object constructors blow up on unknown attributes =head1 VERSION version 0.19 =head1 SYNOPSIS package My::Class; use Moose; use MooseX::StrictConstructor; has 'size' => ...; # then later ... # this blows up because color is not a known attribute My::Class->new( size => 5, color => 'blue' ); =head1 DESCRIPTION Simply loading this module makes your constructors "strict". If your constructor is called with an attribute init argument that your class does not declare, then it calls C<< Moose->throw_error() >>. This is a great way to catch small typos. =head2 Subverting Strictness You may find yourself wanting to have your constructor accept a parameter which does not correspond to an attribute. In that case, you'll probably also be writing a C or C method to deal with that parameter. In a C method, you can simply make sure that this parameter is not included in the hash reference you return. Otherwise, in a C method, you can delete it from the hash reference of parameters. sub BUILD { my $self = shift; my $params = shift; if ( delete $params->{do_something} ) { ... } } =head1 BUGS Please report any bugs or feature requests to C, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 AUTHOR Dave Rolsky =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) =cut __END__ MooseX-StrictConstructor-0.19/lib/MooseX/StrictConstructor/0000755000175000017500000000000011705366560023740 5ustar autarchautarchMooseX-StrictConstructor-0.19/lib/MooseX/StrictConstructor/Trait/0000755000175000017500000000000011705366560025023 5ustar autarchautarchMooseX-StrictConstructor-0.19/lib/MooseX/StrictConstructor/Trait/Class.pm0000644000175000017500000000432611705366560026433 0ustar autarchautarchpackage MooseX::StrictConstructor::Trait::Class; { $MooseX::StrictConstructor::Trait::Class::VERSION = '0.19'; } use Moose::Role; use namespace::autoclean; use B (); around new_object => sub { my $orig = shift; my $self = shift; my $params = @_ == 1 ? $_[0] : {@_}; my $instance = $self->$orig(@_); my %attrs = ( __INSTANCE__ => 1, ( map { $_ => 1 } grep {defined} map { $_->init_arg() } $self->get_all_attributes() ) ); my @bad = sort grep { !$attrs{$_} } keys %$params; if (@bad) { $self->throw_error( "Found unknown attribute(s) init_arg passed to the constructor: @bad" ); } return $instance; }; around _inline_BUILDALL => sub { my $orig = shift; my $self = shift; my @source = $self->$orig(); my @attrs = ( '__INSTANCE__ => 1,', map { B::perlstring($_) . ' => 1,' } grep {defined} map { $_->init_arg() } $self->get_all_attributes() ); return ( @source, 'my @bad = sort grep { !$allowed_attrs{$_} } keys %{ $params };', 'if (@bad) {', 'Moose->throw_error("Found unknown attribute(s) passed to the constructor: @bad");', '}', ); } if $Moose::VERSION >= 1.9900; around _eval_environment => sub { my $orig = shift; my $self = shift; my $env = $self->$orig(); my %attrs = map { $_ => 1 } grep { defined } map { $_->init_arg() } $self->get_all_attributes(); $attrs{__INSTANCE__} = 1; $env->{'%allowed_attrs'} = \%attrs; return $env; } if $Moose::VERSION >= 1.9900; 1; # ABSTRACT: A role to make immutable constructors strict =pod =head1 NAME MooseX::StrictConstructor::Trait::Class - A role to make immutable constructors strict =head1 VERSION version 0.19 =head1 DESCRIPTION This role simply wraps C<_inline_BUILDALL()> (from C) so that immutable classes have a strict constructor. =head1 AUTHOR Dave Rolsky =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) =cut __END__ MooseX-StrictConstructor-0.19/lib/MooseX/StrictConstructor/Trait/Method/0000755000175000017500000000000011705366560026243 5ustar autarchautarchMooseX-StrictConstructor-0.19/lib/MooseX/StrictConstructor/Trait/Method/Constructor.pm0000644000175000017500000000257511705366560031137 0ustar autarchautarchpackage MooseX::StrictConstructor::Trait::Method::Constructor; { $MooseX::StrictConstructor::Trait::Method::Constructor::VERSION = '0.19'; } use Moose::Role; use namespace::autoclean; use B (); around _generate_BUILDALL => sub { my $orig = shift; my $self = shift; my $source = $self->$orig(); $source .= ";\n" if $source; my @attrs = '__INSTANCE__ => 1,'; push @attrs, map { B::perlstring($_) . ' => 1,' } grep { defined } map { $_->init_arg() } @{ $self->_attributes() }; $source .= <<"EOF"; my \%attrs = (@attrs); my \@bad = sort grep { ! \$attrs{\$_} } keys \%{ \$params }; if (\@bad) { Moose->throw_error("Found unknown attribute(s) passed to the constructor: \@bad"); } EOF return $source; } if $Moose::VERSION < 1.9900; 1; # ABSTRACT: A role to make immutable constructors strict =pod =head1 NAME MooseX::StrictConstructor::Trait::Method::Constructor - A role to make immutable constructors strict =head1 VERSION version 0.19 =head1 DESCRIPTION This role simply wraps C<_generate_BUILDALL()> (from C) so that immutable classes have a strict constructor. =head1 AUTHOR Dave Rolsky =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) =cut __END__ MooseX-StrictConstructor-0.19/README0000644000175000017500000000043411705366560017123 0ustar autarchautarch This archive contains the distribution MooseX-StrictConstructor, version 0.19: Make your object constructors blow up on unknown attributes This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) MooseX-StrictConstructor-0.19/LICENSE0000644000175000017500000002152011705366560017247 0ustar autarchautarchThis software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) The Artistic License 2.0 Copyright (c) 2000-2006, The Perl Foundation. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software. You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement. Definitions "Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package. "Contributor" means any party that has contributed code or other material to the Package, in accordance with the Copyright Holder's procedures. "You" and "your" means any person who would like to copy, distribute, or modify the Package. "Package" means the collection of files distributed by the Copyright Holder, and derivatives of that collection and/or of those files. A given Package may consist of either the Standard Version, or a Modified Version. "Distribute" means providing a copy of the Package or making it accessible to anyone else, or in the case of a company or organization, to others outside of your company or organization. "Distributor Fee" means any fee that you charge for Distributing this Package or providing support for this Package to another party. It does not mean licensing fees. "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways explicitly requested by the Copyright Holder. "Modified Version" means the Package, if it has been changed, and such changes were not explicitly requested by the Copyright Holder. "Original License" means this Artistic License as Distributed with the Standard Version of the Package, in its current version or as it may be modified by The Perl Foundation in the future. "Source" form means the source code, documentation source, and configuration files for the Package. "Compiled" form means the compiled bytecode, object code, binary, or any other form resulting from mechanical transformation or translation of the Source form. Permission for Use and Modification Without Distribution (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. Permissions for Redistribution of the Standard Version (2) You may Distribute verbatim copies of the Source form of the Standard Version of this Package in any medium without restriction, either gratis or for a Distributor Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At your discretion, such verbatim copies may or may not include a Compiled form of the Package. (3) You may apply any bug fixes, portability changes, and other modifications made available from the Copyright Holder. The resulting Package will still be considered the Standard Version, and as such will be subject to the Original License. Distribution of Modified Versions of the Package as Source (4) You may Distribute your Modified Version as Source (either gratis or for a Distributor Fee, and with or without a Compiled form of the Modified Version) provided that you clearly document how it differs from the Standard Version, including, but not limited to, documenting any non-standard features, executables, or modules, and provided that you do at least ONE of the following: (a) make the Modified Version available to the Copyright Holder of the Standard Version, under the Original License, so that the Copyright Holder may include your modifications in the Standard Version. (b) ensure that installation of your Modified Version does not prevent the user installing or running the Standard Version. In addition, the Modified Version must bear a name that is different from the name of the Standard Version. (c) allow anyone who receives a copy of the Modified Version to make the Source form of the Modified Version available to others under (i) the Original License or (ii) a license that permits the licensee to freely copy, modify and redistribute the Modified Version using the same licensing terms that apply to the copy that the licensee received, and requires that the Source form of the Modified Version, and of any works derived from it, be made freely available in that license fees are prohibited but Distributor Fees are allowed. Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source (5) You may Distribute Compiled forms of the Standard Version without the Source, provided that you include complete instructions on how to get the Source of the Standard Version. Such instructions must be valid at the time of your distribution. If these instructions, at any time while you are carrying out such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If you provide valid instructions or cease distribution within thirty days after you become aware that the instructions are invalid, then you do not forfeit any of your rights under this license. (6) You may Distribute a Modified Version in Compiled form without the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. Aggregating or Linking the Package (7) You may aggregate the Package (either the Standard Version or Modified Version) with other packages and Distribute the resulting aggregation provided that you do not charge a licensing fee for the Package. Distributor Fees are permitted, and licensing fees for other components in the aggregation are permitted. The terms of this license apply to the use and Distribution of the Standard or Modified Versions as included in the aggregation. (8) You are permitted to link Modified and Standard Versions with other works, to embed the Package in a larger work of your own, or to build stand-alone binary or bytecode versions of applications that include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. Items That are Not Considered Part of a Modified Version (9) Works (including, but not limited to, modules and scripts) that merely extend or make use of the Package, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not subject to the terms of this license. General Provisions (10) Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. (11) If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. (12) This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. (13) This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. (14) Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MooseX-StrictConstructor-0.19/META.yml0000644000175000017500000000144211705366560017514 0ustar autarchautarch--- abstract: 'Make your object constructors blow up on unknown attributes' author: - 'Dave Rolsky ' build_requires: Test::Fatal: 0 Test::Moose: 0 Test::More: 0.88 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300006, CPAN::Meta::Converter version 2.113640' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: MooseX-StrictConstructor requires: B: 0 Moose: 0.94 Moose::Exporter: 0 Moose::Role: 0 Moose::Util::MetaRole: 0 namespace::autoclean: 0 strict: 0 warnings: 0 resources: bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-StrictConstructor repository: git://git.moose.perl.org/MooseX-StrictConstructor.git version: 0.19 MooseX-StrictConstructor-0.19/Makefile.PL0000644000175000017500000000241411705366560020215 0ustar autarchautarch use strict; use warnings; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "Make your object constructors blow up on unknown attributes", "AUTHOR" => "Dave Rolsky ", "BUILD_REQUIRES" => { "Test::Fatal" => 0, "Test::Moose" => 0, "Test::More" => "0.88" }, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "MooseX-StrictConstructor", "EXE_FILES" => [], "LICENSE" => "artistic_2", "NAME" => "MooseX::StrictConstructor", "PREREQ_PM" => { "B" => 0, "Moose" => "0.94", "Moose::Exporter" => 0, "Moose::Role" => 0, "Moose::Util::MetaRole" => 0, "namespace::autoclean" => 0, "strict" => 0, "warnings" => 0 }, "VERSION" => "0.19", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); MooseX-StrictConstructor-0.19/Changes0000644000175000017500000000476611705366560017552 0ustar autarchautarch0.19 2012-01-17 - The 0.17 release broke compatibility with pre-2.0 versions of Moose. 0.18 2012-01-10 - A small internal tweak which prevents the MooseX::ClassCompositor tests from failing. 0.17 2012-01-04 - Added a small optimization for an immutable constructor when used with Moose 2.00+. The list of valid attributes is only generated once, rather than each time the constructor is run. Reported by Chip Salzenberg. RT #73664. 0.16 2011-04-22 - Don't wrap BUILDALL, since this breaks if the object doesn't inherit from Moose::Object (doy). 0.15 2011-04-13 - The fix in 0.14 only worked with Moose 2.0, causing failures with earlier versions. 0.14 2011-04-13 - Using extends caused strictness to be lost. Fixed by Karen Etheridge. 0.13 2011-02-22 - This release provides forward compatibility with Moose 1.99+. It will still work with Moose 1.23 as well. Most of the work was done by Jesse Luehrs. 0.12 2010-10-29 - Switched tests to use Test::Fatal instead of Test::Exception. 0.11 2010-09-09 - Added a missing test dep on Test::Exception. Reported by Phillip Moore. RT #61205. 0.10 2010-07-16 - Ignore __INSTANCE__ when passed to the constructor. Patch by Jesse Luehrs. RT #59236. - All init args are quoted in the inlined constructor. 0.09 2010-07-14 - Use modern Moose APIs, to avoid warnings with the next Moose release. 0.08 2009-04-07 - Make this module work with Moose 0.73_01+. 0.07 2008-09-01 - No code changes, just a stable release for Moose 0.56. 0.06_02 2008-08-30 * This module no longer exports Moose's sugar. Just use Moose instead. - Various doc fixes to reflect changes since 0.06. 0.06_01 2008-08-30 - Rewrote this distro's functionality as roles to take advantage of Moose::Util::MetaRole. Less code, plays better with other extensions. 0.06 2008-06-27 - Changes to the immutable bits to work with the latest Moose (0.51). 0.05 2008-04-18 - The fix in 0.04 only worked for non-immutable classes. 0.04 2008-04-18 - This module did not respect the init_arg attribute setting, and used the attribute name instead. Reported by Matt Trout. RT #34507. 0.03 2007-11-20 - Require Moose 0.26, since that's first version to offer init_meta(), apparently. 0.02 2007-11-15 - Moose was missing from the prereq list. Reported by Slaven Rezic. - Version 0.01 did not work after a class was made immutable. 0.01 2007-11-14 - First version, released on an unsuspecting world. MooseX-StrictConstructor-0.19/META.json0000644000175000017500000000303011705366560017657 0ustar autarchautarch{ "abstract" : "Make your object constructors blow up on unknown attributes", "author" : [ "Dave Rolsky " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.300006, CPAN::Meta::Converter version 2.113640", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "MooseX-StrictConstructor", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "runtime" : { "requires" : { "B" : 0, "Moose" : "0.94", "Moose::Exporter" : 0, "Moose::Role" : 0, "Moose::Util::MetaRole" : 0, "namespace::autoclean" : 0, "strict" : 0, "warnings" : 0 } }, "test" : { "requires" : { "Test::Fatal" : 0, "Test::Moose" : 0, "Test::More" : "0.88" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-moosex-strictconstructor@rt.cpan.org", "web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-StrictConstructor" }, "repository" : { "type" : "git", "url" : "git://git.moose.perl.org/MooseX-StrictConstructor.git", "web" : "http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/MooseX-StrictConstructor.git;a=summary" } }, "version" : "0.19" } MooseX-StrictConstructor-0.19/INSTALL0000644000175000017500000000201611705366560017272 0ustar autarchautarch This is the Perl distribution MooseX-StrictConstructor. Installing MooseX-StrictConstructor is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm MooseX::StrictConstructor If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S MooseX::StrictConstructor ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan MooseX::StrictConstructor ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Makefile.PL % make && make test Then install it: % make install If you are installing into a system-wide directory, you may need to run: % sudo make install ## Documentation MooseX-StrictConstructor documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc MooseX::StrictConstructor MooseX-StrictConstructor-0.19/dist.ini0000644000175000017500000000147511705366560017715 0ustar autarchautarchname = MooseX-StrictConstructor author = Dave Rolsky license = Artistic_2_0 copyright_holder = Dave Rolsky version = 0.19 [NextRelease] format = %-8v %{yyyy-MM-dd}d [@Basic] [InstallGuide] [MetaJSON] [MetaResources] bugtracker.web = http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-StrictConstructor bugtracker.mailto = bug-moosex-strictconstructor@rt.cpan.org repository.url = git://git.moose.perl.org/MooseX-StrictConstructor.git repository.web = http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/MooseX-StrictConstructor.git;a=summary repository.type = git [PodWeaver] [PkgVersion] [EOLTests] [NoTabsTests] [PodSyntaxTests] [Test::CPAN::Changes] [Test::Pod::LinkCheck] [Test::Pod::No404s] [CheckChangeLog] [AutoPrereqs] skip = Standard skip = Stricter [CheckPrereqsIndexed] [@Git]