MooseX-AbstractMethod-0.004/0000775000076400007640000000000012020061250014657 5ustar cweylcweylMooseX-AbstractMethod-0.004/lib/0000775000076400007640000000000012020061250015425 5ustar cweylcweylMooseX-AbstractMethod-0.004/lib/MooseX/0000775000076400007640000000000012020061250016637 5ustar cweylcweylMooseX-AbstractMethod-0.004/lib/MooseX/AbstractMethod.pm0000644000076400007640000001241612020061250022103 0ustar cweylcweyl# # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # package MooseX::AbstractMethod; { $MooseX::AbstractMethod::VERSION = '0.004'; } # ABSTRACT: Declare methods requirements that must be satisfied use Moose 0.94 (); use namespace::autoclean; use Moose::Exporter; use Moose::Util::MetaRole; # debugging... #use Smart::Comments; { package MooseX::AbstractMethod::Trait::Class; { $MooseX::AbstractMethod::Trait::Class::VERSION = '0.004'; } use Moose::Role; use namespace::autoclean; use Moose::Util qw{ does_role english_list }; sub abstract_method_metaclass { my $self = shift @_; return Moose::Meta::Class ->create_anon_class( # XXX should this just be Moose::Meta::Method as the superclass?? superclasses => [ $self->method_metaclass ], roles => [ 'MooseX::AbstractMethod::Trait::Method' ], cache => 1, ) ->name ; } sub add_abstract_method { my ($self, @names) = @_; my $abstract_meta = $self->abstract_method_metaclass; for my $name (@names) { my $method = $abstract_meta->wrap( sub { Moose->throw_error("Method $name is not implemented!") }, name => $name, package_name => $self->name, ); $self->add_method($name => $method); } return; } # blow up if we're being asked to become immutable, we're a subclasss, # and we don't implement an abstract method before make_immutable => sub { my $self = shift @_; my @abstract_methods = sort map { $_->name . ' (from ' . $_->original_package_name . ')' } grep { $_->original_package_name ne $self->name } grep { does_role($_, 'MooseX::AbstractMethod::Trait::Method') } $self->get_all_methods ; Moose->throw_error( 'These abstract methods have not been implemented in ' . $self->name . ': ' . english_list(@abstract_methods) ) if @abstract_methods; return; }; } { package MooseX::AbstractMethod::Trait::Method; { $MooseX::AbstractMethod::Trait::Method::VERSION = '0.004'; } use Moose::Role; use namespace::autoclean; # well, hello there handsome :) } sub abstract { _abstract(@_) } sub requires { _abstract(@_) } sub _abstract { ### meta isa: ref $_[0] return shift->add_abstract_method(@_) unless $_[0]->isa('Moose::Meta::Role'); goto \&Moose::Role::requires; } Moose::Exporter->setup_import_methods( with_meta => [ qw{ abstract requires } ], trait_aliases => [ [ 'MooseX::AbstractMethod::Trait::Method' => 'AbstractMethod' ], ], class_metaroles => { class => [ 'MooseX::AbstractMethod::Trait::Class' ], }, ); !!42; __END__ =pod =encoding utf-8 =for :stopwords Chris Weyl =head1 NAME MooseX::AbstractMethod - Declare methods requirements that must be satisfied =head1 VERSION This document describes version 0.004 of MooseX::AbstractMethod - released August 31, 2012 as part of MooseX-AbstractMethod. =head1 SYNOPSIS use Moose; use MooseX::Abstract; requires 'bar'; # synonm to 'requires' abstract 'foo'; =head1 DESCRIPTION This extensions allows classes to flag certain methods as being required to be implemented by a subclass, much as a L does with 'requires'. =head1 USAGE As in the synopsis, simply mark certain methods as being required by subclasses by passing their names to "abstract" or "requires". This will cause a method of the same name to be installed in the class that will die horribly if it's ever called. Additionally, when a class is made immutable, all of its methods are checked to see if they're marked as abstract; if any abstract methods exists that were not created in the current class, we die horribly. Checking for method satisfaction on make_immutable isn't perfect, but AFAICT it's the most reasonable approach possible at the moment. (Corrections welcome.) =head1 NEW SUGAR =head2 abstract abstract() allows one to declare a method dependency that must be satisfied by a subclass before it is invoked, and before the subclass is made immutable. abstract 'method_name_that_must_be_satisfied'; =head2 requires requires() is a synonym for abstract() and works in the way you'd expect. =head1 SOURCE The development version is on github at L and may be cloned from L =head1 BUGS Please report any bugs or feature requests on the bugtracker website https://github.com/RsrchBoy/moosex-abstractmethod/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. =head1 AUTHOR Chris Weyl =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999 =cut MooseX-AbstractMethod-0.004/Makefile.PL0000644000076400007640000000255712020061250016640 0ustar cweylcweyl use strict; use warnings; use 5.006; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "Declare methods requirements that must be satisfied", "AUTHOR" => "Chris Weyl ", "BUILD_REQUIRES" => { "File::Find" => 0, "File::Temp" => 0, "MooseX::Traits" => 0, "Test::Fatal" => 0, "Test::Moose" => 0, "Test::More" => "0.88", "constant" => 0, "strict" => 0, "warnings" => 0 }, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "MooseX-AbstractMethod", "EXE_FILES" => [], "LICENSE" => "lgpl", "NAME" => "MooseX::AbstractMethod", "PREREQ_PM" => { "Moose" => "0.94", "Moose::Exporter" => 0, "Moose::Role" => 0, "Moose::Util" => 0, "Moose::Util::MetaRole" => 0, "namespace::autoclean" => 0 }, "VERSION" => "0.004", "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-AbstractMethod-0.004/SIGNATURE0000644000076400007640000000514612020061250016147 0ustar cweylcweylThis file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.68. 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: SHA1 SHA1 9390cff503c49d42bc7e6826ae09fdb23e2e5e95 Changes SHA1 16a829b63c580531f16c45a6625e7559826c72d1 INSTALL SHA1 514760f01d379ad532c49a196f1c6f7912b65556 LICENSE SHA1 9ba78ba6765b368717664d51385c3f6204acfc34 MANIFEST SHA1 a67486dc1cfc725ed92d7ac2cd8df72df1095aa8 META.json SHA1 e2bd293b18e6737d8c85fc213b6ee09c55f2d122 META.yml SHA1 e6f235dbd71245efa129e314e8966c3183716a1b Makefile.PL SHA1 238fa7dbd6892e347bf34afc7d0d7d32f1d328d1 README SHA1 f17edfacbf55e15fae6b7ecbe2926125005d9eec dist.ini SHA1 d23d4f9e7b2f873c38cab0d0e1f364bb9ae2a68e lib/MooseX/AbstractMethod.pm SHA1 cd0e290dcae5429dc4f3dd25a5005fe5396ded75 t/00-compile.t SHA1 4198339ab48f16975090ef61dbdd8b4769e44a11 t/000-load.t SHA1 9e5291e32cab94e87a8fb2ba0d5e4af32fbc1a38 t/000-report-versions-tiny.t SHA1 9be3e632ec5125357f0e0ec43d4a2767364dae45 t/accessor_satisfaction.t SHA1 73566345b5565d0194e1928947ece26746ab14eb t/author-pod-spell.t SHA1 364da3480ec1885086a20134e3d262a913073633 t/basic.t SHA1 9c3627ff37f4fd5bddc34bf46cf3359eaf76a060 t/release-consistent-version.t SHA1 a032c41ef6887fab1b900669c2d304fab46680e2 t/release-eol.t SHA1 a15e27cd35949ca12003f2f08c325ef7ef1cbadc t/release-has-version.t SHA1 45efaffbe09fd8e21d09482cc2f89551974fa9b6 t/release-no-smart-comments.t SHA1 455d1dd1867212a665ad5ea4126b572411de300c t/release-no-tabs.t SHA1 cdc110824b314702e6e7280e67557cb0803f37cf t/release-pod-coverage.t SHA1 8148b021a3d48b4781221e0975001d3764526a5d t/release-pod-syntax.t SHA1 479026324c7877c09ade9779571b644f78ced0e4 t/release-portability.t SHA1 3d8f1ff891d6053154c889afde7e605f361a5180 t/role.t SHA1 972351e09a02551fefa8061e9513bc3e18b1537b t/sanity_check.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJQQGKoAAoJEOd5N1CvIgQkXZ0H/R1QaHv+NVXhPDdNa5YidgvG emUCGv+BqdE3u2d89ljq4SgVIXS6y/YnjOrqzl+7yLeE3EdFdYyiXoRMo8ZIR74y UAuHxxzpt14aeB2EBQRe61CU/zh4g949HHCYlzwVRP1xl0NQ12Cfb0sA7xuW78A6 OGwFwuz56FZ8jMAdzUae1ayrO64PKCvDRMK/e7RIzsjjnxA8yT8rc7mnH5ZTCBpb NF3MXvakkEwyQvwD4lo2DV0U9fAiNqR1q6me4MXiO5gMTsUnSXaTZnW9TirBW3En p8itw15e6iG/VvVSipdofVTT2Jz+GKc9g82hLjTkLtHyo7zNleCoyJmSou3+FFc= =vAGX -----END PGP SIGNATURE----- MooseX-AbstractMethod-0.004/META.json0000644000076400007640000003113112020061250016275 0ustar cweylcweyl{ "abstract" : "Declare methods requirements that must be satisfied", "author" : [ "Chris Weyl " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.300021, CPAN::Meta::Converter version 2.120921", "license" : [ "lgpl_2_1" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "MooseX-AbstractMethod", "no_index" : { "directory" : [ "corpus", "t" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "runtime" : { "requires" : { "Moose" : "0.94", "Moose::Exporter" : "0", "Moose::Role" : "0", "Moose::Util" : "0", "Moose::Util::MetaRole" : "0", "namespace::autoclean" : "0", "perl" : "5.006" } }, "test" : { "requires" : { "File::Find" : "0", "File::Temp" : "0", "MooseX::Traits" : "0", "Test::Fatal" : "0", "Test::Moose" : "0", "Test::More" : "0.88", "constant" : "0", "strict" : "0", "warnings" : "0" } } }, "provides" : { "MooseX::AbstractMethod" : { "file" : "lib/MooseX/AbstractMethod.pm", "version" : "0.004" }, "MooseX::AbstractMethod::Trait::Class" : { "file" : "lib/MooseX/AbstractMethod.pm", "version" : "0.004" }, "MooseX::AbstractMethod::Trait::Method" : { "file" : "lib/MooseX/AbstractMethod.pm", "version" : "0.004" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/RsrchBoy/moosex-abstractmethod/issues" }, "homepage" : "http://metacpan.org/release/MooseX-AbstractMethod/", "repository" : { "type" : "git", "url" : "git://github.com/RsrchBoy/moosex-abstractmethod.git", "web" : "https://github.com/RsrchBoy/moosex-abstractmethod" } }, "version" : "0.004", "x_Dist_Zilla" : { "plugins" : [ { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::NextRelease", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@RSRCHBOY/@Git/Check", "version" : "1.121820" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@RSRCHBOY/@Git/Commit", "version" : "1.121820" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@RSRCHBOY/@Git/Tag", "version" : "1.121820" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "@RSRCHBOY/@Git/Push", "version" : "1.121820" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::Git::NextVersion", "version" : "1.121820" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::CorrectBranch", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::Fixups", "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::Fixups", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::GatherDir", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::GatherDir", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::PruneCruft", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::ExecDir", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::ShareDir", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::MakeMaker", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::InstallGuide", "version" : "1.200000" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::Manifest", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::SurgicalPkgVersion", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::SurgicalPkgVersion", "version" : "0.0019" }, { "class" : "Dist::Zilla::Plugin::ReadmeFromPod", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::ReadmeFromPod", "version" : "0.16" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::MinimumPerl", "version" : "1.003" }, { "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::ReportVersions::Tiny", "version" : "1.05" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::AutoPrereqs", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::Prepender", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::Prepender", "version" : "1.112280" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::Test::PodSpelling", "version" : "2.002005" }, { "class" : "Dist::Zilla::Plugin::ConsistentVersionTest", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::ConsistentVersionTest", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::PodCoverageTests", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::PodSyntaxTests", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::NoTabsTests", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::NoTabsTests", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::EOLTests", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::EOLTests", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::HasVersionTests", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::HasVersionTests", "version" : "1.101420" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::Test::Compile", "version" : "1.112820" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::Test::Portability", "version" : "2.000003" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::ExtraTests", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::NoSmartCommentsTests", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::NoSmartCommentsTests", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::MetaConfig", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::MetaJSON", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::MetaYAML", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::MetaNoIndex", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::MetaProvides::Package", "version" : "1.14000001" }, { "class" : "Dist::Zilla::Plugin::GitHub::Meta", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::GitHub::Meta", "version" : "0.27" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::TestRelease", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::CheckChangesHasContent", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::CheckPrereqsIndexed", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::ConfirmRelease", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::GitHub::Update", "version" : "0.27" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::UploadToCPAN", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::Signature", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::Signature", "version" : "1.100930" }, { "class" : "Dist::Zilla::Plugin::Twitter", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::Twitter", "version" : "0.017" }, { "class" : "Dist::Zilla::Plugin::InstallRelease", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::InstallRelease", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::ArchiveRelease", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::ArchiveRelease", "version" : "4.00" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::License", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromBuild", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::CopyFilesFromBuild", "version" : "0.103510" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "name" : "@RSRCHBOY/ReadmePodInRoot", "version" : "0.120120" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "name" : "@RSRCHBOY/Dist::Zilla::Plugin::PodWeaver", "version" : "3.101641" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "4.300021" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "4.300021" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "4.300021" } } } MooseX-AbstractMethod-0.004/META.yml0000644000076400007640000002136712020061250016137 0ustar cweylcweyl--- abstract: 'Declare methods requirements that must be satisfied' author: - 'Chris Weyl ' build_requires: File::Find: 0 File::Temp: 0 MooseX::Traits: 0 Test::Fatal: 0 Test::Moose: 0 Test::More: 0.88 constant: 0 strict: 0 warnings: 0 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300021, CPAN::Meta::Converter version 2.120921' license: lgpl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: MooseX-AbstractMethod no_index: directory: - corpus - t provides: MooseX::AbstractMethod: file: lib/MooseX/AbstractMethod.pm version: 0.004 MooseX::AbstractMethod::Trait::Class: file: lib/MooseX/AbstractMethod.pm version: 0.004 MooseX::AbstractMethod::Trait::Method: file: lib/MooseX/AbstractMethod.pm version: 0.004 requires: Moose: 0.94 Moose::Exporter: 0 Moose::Role: 0 Moose::Util: 0 Moose::Util::MetaRole: 0 namespace::autoclean: 0 perl: 5.006 resources: bugtracker: https://github.com/RsrchBoy/moosex-abstractmethod/issues homepage: http://metacpan.org/release/MooseX-AbstractMethod/ repository: git://github.com/RsrchBoy/moosex-abstractmethod.git version: 0.004 x_Dist_Zilla: plugins: - class: Dist::Zilla::Plugin::NextRelease name: '@RSRCHBOY/Dist::Zilla::Plugin::NextRelease' version: 4.300021 - class: Dist::Zilla::Plugin::Git::Check name: '@RSRCHBOY/@Git/Check' version: 1.121820 - class: Dist::Zilla::Plugin::Git::Commit name: '@RSRCHBOY/@Git/Commit' version: 1.121820 - class: Dist::Zilla::Plugin::Git::Tag name: '@RSRCHBOY/@Git/Tag' version: 1.121820 - class: Dist::Zilla::Plugin::Git::Push name: '@RSRCHBOY/@Git/Push' version: 1.121820 - class: Dist::Zilla::Plugin::Git::NextVersion name: '@RSRCHBOY/Dist::Zilla::Plugin::Git::NextVersion' version: 1.121820 - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::CorrectBranch' version: 0.004 - class: Dist::Zilla::Plugin::Git::CheckFor::Fixups name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::Fixups' version: 0.004 - class: Dist::Zilla::Plugin::GatherDir name: '@RSRCHBOY/Dist::Zilla::Plugin::GatherDir' version: 4.300021 - class: Dist::Zilla::Plugin::PruneCruft name: '@RSRCHBOY/Dist::Zilla::Plugin::PruneCruft' version: 4.300021 - class: Dist::Zilla::Plugin::ExecDir name: '@RSRCHBOY/Dist::Zilla::Plugin::ExecDir' version: 4.300021 - class: Dist::Zilla::Plugin::ShareDir name: '@RSRCHBOY/Dist::Zilla::Plugin::ShareDir' version: 4.300021 - class: Dist::Zilla::Plugin::MakeMaker name: '@RSRCHBOY/Dist::Zilla::Plugin::MakeMaker' version: 4.300021 - class: Dist::Zilla::Plugin::InstallGuide name: '@RSRCHBOY/Dist::Zilla::Plugin::InstallGuide' version: 1.200000 - class: Dist::Zilla::Plugin::Manifest name: '@RSRCHBOY/Dist::Zilla::Plugin::Manifest' version: 4.300021 - class: Dist::Zilla::Plugin::SurgicalPkgVersion name: '@RSRCHBOY/Dist::Zilla::Plugin::SurgicalPkgVersion' version: 0.0019 - class: Dist::Zilla::Plugin::ReadmeFromPod name: '@RSRCHBOY/Dist::Zilla::Plugin::ReadmeFromPod' version: 0.16 - class: Dist::Zilla::Plugin::MinimumPerl name: '@RSRCHBOY/Dist::Zilla::Plugin::MinimumPerl' version: 1.003 - class: Dist::Zilla::Plugin::ReportVersions::Tiny name: '@RSRCHBOY/Dist::Zilla::Plugin::ReportVersions::Tiny' version: 1.05 - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RSRCHBOY/Dist::Zilla::Plugin::AutoPrereqs' version: 4.300021 - class: Dist::Zilla::Plugin::Prepender name: '@RSRCHBOY/Dist::Zilla::Plugin::Prepender' version: 1.112280 - class: Dist::Zilla::Plugin::Test::PodSpelling name: '@RSRCHBOY/Dist::Zilla::Plugin::Test::PodSpelling' version: 2.002005 - class: Dist::Zilla::Plugin::ConsistentVersionTest name: '@RSRCHBOY/Dist::Zilla::Plugin::ConsistentVersionTest' version: 0.02 - class: Dist::Zilla::Plugin::PodCoverageTests name: '@RSRCHBOY/Dist::Zilla::Plugin::PodCoverageTests' version: 4.300021 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RSRCHBOY/Dist::Zilla::Plugin::PodSyntaxTests' version: 4.300021 - class: Dist::Zilla::Plugin::NoTabsTests name: '@RSRCHBOY/Dist::Zilla::Plugin::NoTabsTests' version: 0.01 - class: Dist::Zilla::Plugin::EOLTests name: '@RSRCHBOY/Dist::Zilla::Plugin::EOLTests' version: 0.02 - class: Dist::Zilla::Plugin::HasVersionTests name: '@RSRCHBOY/Dist::Zilla::Plugin::HasVersionTests' version: 1.101420 - class: Dist::Zilla::Plugin::Test::Compile name: '@RSRCHBOY/Dist::Zilla::Plugin::Test::Compile' version: 1.112820 - class: Dist::Zilla::Plugin::Test::Portability name: '@RSRCHBOY/Dist::Zilla::Plugin::Test::Portability' version: 2.000003 - class: Dist::Zilla::Plugin::ExtraTests name: '@RSRCHBOY/Dist::Zilla::Plugin::ExtraTests' version: 4.300021 - class: Dist::Zilla::Plugin::NoSmartCommentsTests name: '@RSRCHBOY/Dist::Zilla::Plugin::NoSmartCommentsTests' version: 0.006 - class: Dist::Zilla::Plugin::MetaConfig name: '@RSRCHBOY/Dist::Zilla::Plugin::MetaConfig' version: 4.300021 - class: Dist::Zilla::Plugin::MetaJSON name: '@RSRCHBOY/Dist::Zilla::Plugin::MetaJSON' version: 4.300021 - class: Dist::Zilla::Plugin::MetaYAML name: '@RSRCHBOY/Dist::Zilla::Plugin::MetaYAML' version: 4.300021 - class: Dist::Zilla::Plugin::MetaNoIndex name: '@RSRCHBOY/Dist::Zilla::Plugin::MetaNoIndex' version: 4.300021 - class: Dist::Zilla::Plugin::MetaProvides::Package name: '@RSRCHBOY/Dist::Zilla::Plugin::MetaProvides::Package' version: 1.14000001 - class: Dist::Zilla::Plugin::GitHub::Meta name: '@RSRCHBOY/Dist::Zilla::Plugin::GitHub::Meta' version: 0.27 - class: Dist::Zilla::Plugin::TestRelease name: '@RSRCHBOY/Dist::Zilla::Plugin::TestRelease' version: 4.300021 - class: Dist::Zilla::Plugin::CheckChangesHasContent name: '@RSRCHBOY/Dist::Zilla::Plugin::CheckChangesHasContent' version: 0.006 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RSRCHBOY/Dist::Zilla::Plugin::CheckPrereqsIndexed' version: 0.007 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RSRCHBOY/Dist::Zilla::Plugin::ConfirmRelease' version: 4.300021 - class: Dist::Zilla::Plugin::GitHub::Update name: '@RSRCHBOY/Dist::Zilla::Plugin::GitHub::Update' version: 0.27 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RSRCHBOY/Dist::Zilla::Plugin::UploadToCPAN' version: 4.300021 - class: Dist::Zilla::Plugin::Signature name: '@RSRCHBOY/Dist::Zilla::Plugin::Signature' version: 1.100930 - class: Dist::Zilla::Plugin::Twitter name: '@RSRCHBOY/Dist::Zilla::Plugin::Twitter' version: 0.017 - class: Dist::Zilla::Plugin::InstallRelease name: '@RSRCHBOY/Dist::Zilla::Plugin::InstallRelease' version: 0.008 - class: Dist::Zilla::Plugin::ArchiveRelease name: '@RSRCHBOY/Dist::Zilla::Plugin::ArchiveRelease' version: 4.00 - class: Dist::Zilla::Plugin::License name: '@RSRCHBOY/Dist::Zilla::Plugin::License' version: 4.300021 - class: Dist::Zilla::Plugin::CopyFilesFromBuild name: '@RSRCHBOY/Dist::Zilla::Plugin::CopyFilesFromBuild' version: 0.103510 - class: Dist::Zilla::Plugin::ReadmeAnyFromPod name: '@RSRCHBOY/ReadmePodInRoot' version: 0.120120 - class: Dist::Zilla::Plugin::PodWeaver name: '@RSRCHBOY/Dist::Zilla::Plugin::PodWeaver' version: 3.101641 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 4.300021 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 4.300021 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 4.300021 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 4.300021 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 4.300021 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 4.300021 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 4.300021 MooseX-AbstractMethod-0.004/MANIFEST0000644000076400007640000000070412020061250016007 0ustar cweylcweylChanges INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README SIGNATURE dist.ini lib/MooseX/AbstractMethod.pm t/00-compile.t t/000-load.t t/000-report-versions-tiny.t t/accessor_satisfaction.t t/author-pod-spell.t t/basic.t t/release-consistent-version.t t/release-eol.t t/release-has-version.t t/release-no-smart-comments.t t/release-no-tabs.t t/release-pod-coverage.t t/release-pod-syntax.t t/release-portability.t t/role.t t/sanity_check.t MooseX-AbstractMethod-0.004/t/0000775000076400007640000000000012020061250015122 5ustar cweylcweylMooseX-AbstractMethod-0.004/t/release-consistent-version.t0000644000076400007640000000056212020061250022602 0ustar cweylcweyl 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::ConsistentVersion"; plan skip_all => "Test::ConsistentVersion required for this test" if $@; Test::ConsistentVersion::check_consistent_versions(); MooseX-AbstractMethod-0.004/t/release-no-smart-comments.t0000644000076400007640000000114412020061250022306 0ustar cweylcweyl#!/usr/bin/env perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 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_all(); done_testing(); MooseX-AbstractMethod-0.004/t/000-report-versions-tiny.t0000644000076400007640000000522512020061250021750 0ustar cweylcweyluse strict; use warnings; use Test::More 0.88; # This is a relatively nice way to avoid Test::NoWarnings breaking our # expectations by adding extra tests, without using no_plan. It also helps # avoid any other test module that feels introducing random tests, or even # test plans, is a nice idea. our $success = 0; END { $success && done_testing; } # List our own version used to generate this my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.05\n"; eval { # no excuses! # report our Perl details my $want = '5.006'; my $pv = ($^V || $]); $v .= "perl: $pv (wanted $want) on $^O from $^X\n\n"; }; defined($@) and diag("$@"); # Now, our module version dependencies: sub pmver { my ($module, $wanted) = @_; $wanted = " (want $wanted)"; my $pmver; eval "require $module;"; if ($@) { if ($@ =~ m/Can't locate .* in \@INC/) { $pmver = 'module not found.'; } else { diag("${module}: $@"); $pmver = 'died during require.'; } } else { my $version; eval { $version = $module->VERSION; }; if ($@) { diag("${module}: $@"); $pmver = 'died during VERSION check.'; } elsif (defined $version) { $pmver = "$version"; } else { $pmver = ''; } } # So, we should be good, right? return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n"); } eval { $v .= pmver('ExtUtils::MakeMaker','6.30') }; eval { $v .= pmver('File::Find','any version') }; eval { $v .= pmver('File::Temp','any version') }; eval { $v .= pmver('Moose','0.94') }; eval { $v .= pmver('Moose::Exporter','any version') }; eval { $v .= pmver('Moose::Role','any version') }; eval { $v .= pmver('Moose::Util','any version') }; eval { $v .= pmver('Moose::Util::MetaRole','any version') }; eval { $v .= pmver('MooseX::Traits','any version') }; eval { $v .= pmver('Test::Fatal','any version') }; eval { $v .= pmver('Test::Moose','any version') }; eval { $v .= pmver('Test::More','0.88') }; eval { $v .= pmver('constant','any version') }; eval { $v .= pmver('namespace::autoclean','any version') }; eval { $v .= pmver('strict','any version') }; eval { $v .= pmver('warnings','any version') }; # All done. $v .= <<'EOT'; Thanks for using my code. I hope it works for you. If not, please try and include this output in the bug report. That will help me reproduce the issue and solve your problem. EOT diag($v); ok(1, "we really didn't test anything, just reporting data"); $success = 1; # Work around another nasty module on CPAN. :/ no warnings 'once'; $Template::Test::NO_FLUSH = 1; exit 0; MooseX-AbstractMethod-0.004/t/accessor_satisfaction.t0000644000076400007640000000150112020061250021653 0ustar cweylcweyl#!/usr/bin/env perl # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # make sure methods installed from attributes (accessors and the like) satisfy # our abstract requirement use Test::More 0.82; use Test::Moose; use Moose::Util 'does_role'; { package foo; use Moose; use namespace::autoclean; use MooseX::AbstractMethod; requires 'one'; } { package bar; use Moose; extends 'foo'; has one => (is => 'ro'); } with_immutable { meta_ok('foo'); with_immutable { meta_ok('bar'); isa_ok(bar->meta->get_method('one'), 'Moose::Meta::Method::Accessor'); } qw{ bar }; } qw{ foo }; done_testing; MooseX-AbstractMethod-0.004/t/release-pod-coverage.t0000644000076400007640000000132012020061250021272 0ustar cweylcweyl#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 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::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); MooseX-AbstractMethod-0.004/t/release-portability.t0000644000076400007640000000103412020061250021263 0ustar cweylcweyl#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 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::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); MooseX-AbstractMethod-0.004/t/release-has-version.t0000644000076400007640000000102612020061250021160 0ustar cweylcweyl#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 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-AbstractMethod-0.004/t/release-pod-syntax.t0000644000076400007640000000100312020061250021023 0ustar cweylcweyl#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 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::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); MooseX-AbstractMethod-0.004/t/author-pod-spell.t0000644000076400007640000000105612020061250020506 0ustar cweylcweyl BEGIN { unless ($ENV{AUTHOR_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for testing by the author'); } } use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.002005 eval "use Test::Spelling 0.12; use Pod::Wordlist::hanekomu; 1" or die $@; add_stopwords(); all_pod_files_spelling_ok('bin', 'lib'); __DATA__ AFAICT ABEND RSRCHBOY RSRCHBOY's gpg ini metaclass metaclasses parameterized parameterization subclasses coderef Chris Weyl lib MooseX AbstractMethod MooseX-AbstractMethod-0.004/t/release-no-tabs.t0000644000076400007640000000045012020061250020265 0ustar cweylcweyl 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-AbstractMethod-0.004/t/sanity_check.t0000644000076400007640000000357112020061250017757 0ustar cweylcweyl#!/usr/bin/env perl # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # basically, a test suite to make sure my understanding of how the method MOP # works is correct... and that it stays that way :) use Test::More 0.82; use Test::Moose; use Moose::Util 'does_role'; { package Test::Trait::Method; use Moose::Role; use namespace::autoclean; } my $abstract_meta = Moose::Meta::Class->create_anon_class( superclasses => [ 'Moose::Meta::Method' ], roles => [ 'Test::Trait::Method' ], cache => 1, ); { package foo; use Moose; sub _abstract { my $name = shift; my $method = $abstract_meta->name->wrap(sub { die }, name => $name, package_name => __PACKAGE__, ); __PACKAGE__->meta->add_method($name => $method) } _abstract('dne'); _abstract('dne2'); } { package bar; use Moose; extends 'foo'; sub dne { warn "now implemented!" } } use constant TESTTRAIT => 'Test::Trait::Method'; with_immutable { # base class my $foo_mmeta = foo->meta->get_method('dne'); meta_ok('foo'); does_ok($foo_mmeta, TESTTRAIT); with_immutable { # descendents my $bar_mmeta = bar->meta->find_method_by_name('dne'); my $dne2_mmeta = bar->meta->find_method_by_name('dne2'); # method is overridden ok !does_role($bar_mmeta, TESTTRAIT), 'bar::dne does not do TESTTRAIT';; is 'bar', $bar_mmeta->original_package_name, 'bar::dne from bar'; # method is not overridden ok does_role($dne2_mmeta, TESTTRAIT); is 'foo', $dne2_mmeta->original_package_name, 'bar::dne2 from foo'; } qw{ bar }; } qw{ foo }; done_testing; MooseX-AbstractMethod-0.004/t/release-eol.t0000644000076400007640000000047612020061250017511 0ustar cweylcweyl 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-AbstractMethod-0.004/t/00-compile.t0000644000076400007640000000346012020061250017155 0ustar cweylcweyl#!perl # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 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; use File::Find; use File::Temp qw{ tempdir }; my @modules; find( sub { return if $File::Find::name !~ /\.pm\z/; my $found = $File::Find::name; $found =~ s{^lib/}{}; $found =~ s{[/\\]}{::}g; $found =~ s/\.pm$//; # nothing to skip push @modules, $found; }, 'lib', ); sub _find_scripts { my $dir = shift @_; my @found_scripts = (); find( sub { return unless -f; my $found = $File::Find::name; # nothing to skip open my $FH, '<', $_ or do { note( "Unable to open $found in ( $! ), skipping" ); return; }; my $shebang = <$FH>; return unless $shebang =~ /^#!.*?\bperl\b\s*$/; push @found_scripts, $found; }, $dir, ); return @found_scripts; } my @scripts; do { push @scripts, _find_scripts($_) if -d $_ } for qw{ bin script scripts }; my $plan = scalar(@modules) + scalar(@scripts); $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run"); { # fake home for cpan-testers # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 ); like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" ) for sort @modules; SKIP: { eval "use Test::Script 1.05; 1;"; skip "Test::Script needed to test script compilation", scalar(@scripts) if $@; foreach my $file ( @scripts ) { my $script = $file; $script =~ s!.*/!!; script_compiles( $file, "$script script compiles" ); } } } MooseX-AbstractMethod-0.004/t/000-load.t0000644000076400007640000000061612020061250016524 0ustar cweylcweyl#!/usr/bin/env perl # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use Test::More tests => 1; BEGIN { use_ok 'MooseX::AbstractMethod' } diag("Testing MooseX::AbstractMethod $MooseX::AbstractMethod::VERSION, Perl $], $^X"); MooseX-AbstractMethod-0.004/t/basic.t0000644000076400007640000000161712020061250016373 0ustar cweylcweyl#!/usr/bin/env perl # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # use Test::More 0.82; use Test::Moose; use Test::Fatal; use Moose::Util 'does_role'; { package foo; use Moose; use namespace::autoclean; use MooseX::AbstractMethod; requires 'one'; } { package bar; use Moose; extends 'foo'; sub onetwo { 'whee!' } } { package baz; use Moose; extends 'foo'; sub one { 'whee!' } } with_immutable { meta_ok('foo'); meta_ok('bar'); like( exception { bar->meta->make_immutable }, qr/abstract methods have not been implemented/, 'bar dies', ); is(exception { baz->meta->make_immutable }, undef, 'baz lives'); } qw{ foo }; done_testing; MooseX-AbstractMethod-0.004/t/role.t0000644000076400007640000000227412020061250016253 0ustar cweylcweyl#!/usr/bin/env perl # # This file is part of MooseX-AbstractMethod # # This software is Copyright (c) 2011 by Chris Weyl. # # This is free software, licensed under: # # The GNU Lesser General Public License, Version 2.1, February 1999 # # make sure we don't mess with Moose::Role's require, and simply pass off # our abstract requirement use Test::More 0.82; use Test::Moose; use Moose::Util 'does_role'; use Test::Fatal; { package TestClass::Role; use Moose::Role; use namespace::autoclean; use MooseX::AbstractMethod; requires 'one'; #abstract 'two'; } { package TestClass; use Moose; with 'MooseX::Traits'; #with 'TestClass::Role'; } #{ # package TestClass::Role2; # use Moose::Role; meta_ok('TestClass'); meta_ok 'TestClass::Role'; my $dies = exception { TestClass->with_traits('TestClass::Role') }; like $dies, qr/'TestClass::Role' requires the method 'one' to be implemented/, 'TestClass + role correctly requires one()', ; is_deeply [ TestClass::Role->meta->get_required_method_list ], [ 'one' ], 'TestClass::Role correctly passes to Moose::Role::require', ; done_testing; MooseX-AbstractMethod-0.004/dist.ini0000644000076400007640000000031512020061250016320 0ustar cweylcweylname = MooseX-AbstractMethod author = Chris Weyl license = LGPL_2_1 copyright_holder = Chris Weyl copyright_year = 2011 [@RSRCHBOY] autoprereqs_skip = ^(foo|bar)$ tweet = 1 MooseX-AbstractMethod-0.004/INSTALL0000644000076400007640000000177112020061250015714 0ustar cweylcweyl This is the Perl distribution MooseX-AbstractMethod. Installing MooseX-AbstractMethod is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm MooseX::AbstractMethod 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::AbstractMethod ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan MooseX::AbstractMethod ## 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-AbstractMethod documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc MooseX::AbstractMethod MooseX-AbstractMethod-0.004/LICENSE0000644000076400007640000006011112020061250015661 0ustar cweylcweylThis software is Copyright (c) 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 St, Suite 500, Boston, MA 02110-1335 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-AbstractMethod-0.004/Changes0000644000076400007640000000076212020061250016155 0ustar cweylcweylRevision history for MooseX-AbstractMethod 0.004 2012-08-31 00:07:05 America/Los_Angeles * drop '...' from tests; it was causing v5.12 to be marked as a requirement. 0.003 2012-01-10 12:01:16 America/Los_Angeles * don't mess with roles (that is, have our sugar just hand off to Moose::Role::requires() if we happen to be use'd from a role 0.002 2011-11-15 14:43:39 America/Los_Angeles * documentation updates; nothing else 0.001 2011-09-16 22:09:35 America/Los_Angeles MooseX-AbstractMethod-0.004/README0000644000076400007640000000433412020061250015541 0ustar cweylcweylNAME MooseX::AbstractMethod - Declare methods requirements that must be satisfied VERSION This document describes version 0.004 of MooseX::AbstractMethod - released August 31, 2012 as part of MooseX-AbstractMethod. SYNOPSIS use Moose; use MooseX::Abstract; requires 'bar'; # synonm to 'requires' abstract 'foo'; DESCRIPTION This extensions allows classes to flag certain methods as being required to be implemented by a subclass, much as a Moose::Role does with 'requires'. USAGE As in the synopsis, simply mark certain methods as being required by subclasses by passing their names to "abstract" or "requires". This will cause a method of the same name to be installed in the class that will die horribly if it's ever called. Additionally, when a class is made immutable, all of its methods are checked to see if they're marked as abstract; if any abstract methods exists that were not created in the current class, we die horribly. Checking for method satisfaction on make_immutable isn't perfect, but AFAICT it's the most reasonable approach possible at the moment. (Corrections welcome.) NEW SUGAR abstract abstract() allows one to declare a method dependency that must be satisfied by a subclass before it is invoked, and before the subclass is made immutable. abstract 'method_name_that_must_be_satisfied'; requires requires() is a synonym for abstract() and works in the way you'd expect. SOURCE The development version is on github at and may be cloned from BUGS Please report any bugs or feature requests on the bugtracker website https://github.com/RsrchBoy/moosex-abstractmethod/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 COPYRIGHT AND LICENSE This software is Copyright (c) 2011 by Chris Weyl. This is free software, licensed under: The GNU Lesser General Public License, Version 2.1, February 1999