MooseX-SemiAffordanceAccessor-0.09000755001750001750 011532246052 17444 5ustar00autarchautarch000000000000README000644001750001750 41511532246050 20362 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09 This archive contains the distribution MooseX-SemiAffordanceAccessor, version 0.09: Name your accessors foo() and set_foo() This software is Copyright (c) 2011 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) Changes000644001750001750 217411532246050 21021 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.090.09 2011-02-26 - In Moose 1.9900+, attributes from roles no longer acquire the consuming class's attribute traits. However, you can apply attribute traits like this one to attributes in roles, and that trait is preserved when the role is applied to a class. See the documentation for more details. 0.08 2010-07-20 - Fix a bad example in the SYNOPSIS. 0.07 2010-07-14 - Fix bad uri for bugtracker in metadata 0.06 2010-07-14 - Use modern Moose APIs, to avoid warnings with the next Moose release. 0.05 2009-07-15 - Now requires Moose 0.84 to prevent test failures. 0.04 2009-07-09 - This module unconditionally deleted the "is" parameter, which meant it broke any use of "is => 'bare'". Reported by Jerome Quelin. Fixed by Jesse Luehrs. RT #47711. 0.03 2008-08-30 - Renamed to MooseX::SemiAffordanceAccessor because it no longer requires the Moose::Policy module. Instead it uses Moose::Util::MetaRole. 0.02 2007-11-15 - Require 5.6.1 in the Build.PL. - Added missing Moose & Moose::Policy prereqs. - No code changes. 0.01 2007-11-14 - First version, released on an unsuspecting world. LICENSE000644001750001750 2152011532246050 20547 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09This software is Copyright (c) 2011 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. INSTALL000644001750001750 206111532246050 20552 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09 This is the Perl distribution MooseX-SemiAffordanceAccessor. Installing MooseX-SemiAffordanceAccessor is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm MooseX::SemiAffordanceAccessor 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::SemiAffordanceAccessor ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan MooseX::SemiAffordanceAccessor ## 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-SemiAffordanceAccessor documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc MooseX::SemiAffordanceAccessor dist.ini000644001750001750 141011532246050 21162 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09name = MooseX-SemiAffordanceAccessor author = Dave Rolsky license = Artistic_2_0 copyright_holder = Dave Rolsky copyright_year = 2011 version = 0.09 [@Basic] [InstallGuide] [MetaJSON] [MetaResources] bugtracker.web = http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-SemiAffordanceAccessor bugtracker.mailto = bug-moosex-semiaffordanceaccessor@rt.cpan.org repository.url = git://git.moose.perl.org/MooseX-SemiAffordanceAccessor.git repository.web = http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/MooseX-SemiAffordanceAccessor.git;a=summary repository.type = git [PodWeaver] [PkgVersion] [PodTests] [NoTabsTests] [EOLTests] [Signature] [CheckChangeLog] [Prereqs] Moose = 1.16 [Prereqs / TestRequires] Test::More = 0.88 [@Git] t000755001750001750 011532246050 17626 5ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09role.t000644001750001750 121111532246050 21106 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/tuse strict; use warnings; use Test::More; use Moose (); plan skip_all => 'This test requires Moose 1.9900+' unless $Moose::VERSION ge '1.9900'; { package Role::SAA; use Moose::Role; use MooseX::SemiAffordanceAccessor; has 'foo' => ( is => 'rw' ); has '_bar' => ( is => 'rw' ); } { package Class; use Moose; with 'Role::SAA'; has 'thing' => ( is => 'rw' ); has '_private' => ( is => 'rw' ); } can_ok( 'Class', 'thing' ); ok( ! Class->can('set_thing') ); can_ok( 'Class', '_private' ); ok( ! Class->can('_set_private') ); can_ok( 'Class', qw( foo set_foo _bar _set_bar ) ); done_testing(); META.yml000644001750001750 117711532246050 21001 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09--- abstract: 'Name your accessors foo() and set_foo()' author: - 'Dave Rolsky ' build_requires: Test::More: 0.88 configure_requires: ExtUtils::MakeMaker: 6.31 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.200004, CPAN::Meta::Converter version 2.110240' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: MooseX-SemiAffordanceAccessor requires: Moose: 1.16 resources: bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-SemiAffordanceAccessor repository: git://git.moose.perl.org/MooseX-SemiAffordanceAccessor.git version: 0.09 MANIFEST000644001750001750 46011532246050 20633 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README SIGNATURE dist.ini lib/MooseX/SemiAffordanceAccessor.pm lib/MooseX/SemiAffordanceAccessor/Role/Attribute.pm t/basic.t t/release-eol.t t/release-no-tabs.t t/release-pod-coverage.t t/release-pod-spell.t t/release-pod-syntax.t t/role.t basic.t000644001750001750 332411532246050 21235 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/tuse strict; use warnings; use Test::More; { package Standard; use Moose; has 'thing' => ( is => 'rw' ); has '_private' => ( is => 'rw' ); } { package SAA; use Moose; use MooseX::SemiAffordanceAccessor; has 'thing' => ( is => 'rw' ); has '_private' => ( is => 'rw' ); } { package SAA3; use Moose; use MooseX::SemiAffordanceAccessor; has 'ro' => ( is => 'ro' ); has 'thing' => ( is => 'rw', reader => 'get_thing' ); has 'thing2' => ( is => 'rw', writer => 'set_it' ); } { package SAA4; use Moose; use MooseX::SemiAffordanceAccessor; has bare => ( is => 'bare' ); } ok( Standard->can('thing'), 'Standard->thing() exists' ); ok( !Standard->can('set_thing'), 'Standard->set_thing() does not exist' ); ok( Standard->can('_private'), 'Standard->_private() exists' ); ok( !Standard->can('_set_private'), 'Standard->_set_private() does not exist' ); ok( SAA->can('thing'), 'SAA->thing() exists' ); ok( SAA->can('set_thing'), 'SAA->set_thing() exists' ); ok( SAA->can('_private'), 'SAA->_private() exists' ); ok( SAA->can('_set_private'), 'SAA->_set_private() exists' ); ok( SAA3->can('ro'), 'SAA3->ro exists' ); ok( !SAA3->can('set_ro'), 'SAA3->set_ro does not exist' ); ok( SAA3->can('thing'), 'SAA3->thing exists' ); ok( !SAA3->can('set_thing'), 'SAA3->set_thing does not exist' ); ok( SAA3->can('thing2'), 'SAA3->thing2 exists' ); ok( !SAA3->can('set_thing2'), 'SAA3->set_thing2 does not exist' ); ok( SAA3->can('set_it'), 'SAA3->set_it does exist' ); ok( !SAA4->can('bare'), 'SAA4->bare does not exist' ); ok( !SAA4->can('set_bare'), 'SAA4->set_bare does not exist' ); done_testing(); META.json000644001750001750 240111532246050 21140 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09{ "abstract" : "Name your accessors foo() and set_foo()", "author" : [ "Dave Rolsky " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.200004, CPAN::Meta::Converter version 2.110240", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "MooseX-SemiAffordanceAccessor", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.31" } }, "runtime" : { "requires" : { "Moose" : "1.16" } }, "test" : { "requires" : { "Test::More" : "0.88" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-moosex-semiaffordanceaccessor@rt.cpan.org", "web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-SemiAffordanceAccessor" }, "repository" : { "type" : "git", "url" : "git://git.moose.perl.org/MooseX-SemiAffordanceAccessor.git", "web" : "http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo/MooseX-SemiAffordanceAccessor.git;a=summary" } }, "version" : "0.09" } SIGNATURE000644001750001750 347611532246052 21022 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.66. 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 b5e53632f80e92c57625a5561de2cb3709beb24a Changes SHA1 5aeafa3a768ba582e538bc1cd0adac740e11d630 INSTALL SHA1 c715d20265d2931c7564fc64abfdc4f8ff33e297 LICENSE SHA1 b69bda59e45d196cdbced7f1074246d30a38fef3 MANIFEST SHA1 d2c28a2e7313fa7d80b1e709001fa43e1419d8ec META.json SHA1 b4825f8f4a3bea0ff990eec3230f5889600fcb40 META.yml SHA1 af3f39445a2f56506ed8f0cbc6834372d5d11e1e Makefile.PL SHA1 f04dc494b14a2002cc6267f0326178f8e56a4ab3 README SHA1 14c31b7a733f73056f12c9089b96f43c4090a9ba dist.ini SHA1 2cf03c6072732efb36dd25e5e84f85c535b7136a lib/MooseX/SemiAffordanceAccessor.pm SHA1 a849fa660976bdacc39a5fb7210f133067d53107 lib/MooseX/SemiAffordanceAccessor/Role/Attribute.pm SHA1 83e847e61c6555edf9e0db8457521284aeb626f5 t/basic.t SHA1 a032c41ef6887fab1b900669c2d304fab46680e2 t/release-eol.t SHA1 455d1dd1867212a665ad5ea4126b572411de300c t/release-no-tabs.t SHA1 9433c240fe590bc404ab68ff63984df763e347ed t/release-pod-coverage.t SHA1 cb3e2ea10fc7e63d3c8c82561439919d5780bace t/release-pod-spell.t SHA1 9775e90d40f094f3e5a23c695d6e6e436a2232c3 t/release-pod-syntax.t SHA1 bb0b396b32ac01782231982e84367ece15d568d4 t/role.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk1pTCgACgkQIgMCsV8qvRLGJwCfXbZUpxb8zratHzyVQAgonYAR beIAn0ojBh282CLNgI5dmvgCkjyviLVI =ob67 -----END PGP SIGNATURE----- Makefile.PL000644001750001750 204411532246050 21474 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09 use strict; use warnings; use ExtUtils::MakeMaker 6.31; my %WriteMakefileArgs = ( 'ABSTRACT' => 'Name your accessors foo() and set_foo()', 'AUTHOR' => 'Dave Rolsky ', 'BUILD_REQUIRES' => { 'Test::More' => '0.88' }, 'CONFIGURE_REQUIRES' => { 'ExtUtils::MakeMaker' => '6.31' }, 'DISTNAME' => 'MooseX-SemiAffordanceAccessor', 'EXE_FILES' => [], 'LICENSE' => 'artistic_2', 'NAME' => 'MooseX::SemiAffordanceAccessor', 'PREREQ_PM' => { 'Moose' => '1.16' }, 'VERSION' => '0.09', '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); release-eol.t000644001750001750 47611532246050 22336 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/t 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 }); release-no-tabs.t000644001750001750 45011532246050 23112 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/t 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(); release-pod-spell.t000644001750001750 134211532246050 23467 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/t 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 affordance attribute's init release-pod-syntax.t000644001750001750 45011532246050 23655 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/t#!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.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); release-pod-coverage.t000644001750001750 76511532246050 24133 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/t#!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::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' }); MooseX000755001750001750 011532246050 21343 5ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/libSemiAffordanceAccessor.pm000644001750001750 510211532246050 26367 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/lib/MooseXpackage MooseX::SemiAffordanceAccessor; BEGIN { $MooseX::SemiAffordanceAccessor::VERSION = '0.09'; } use strict; use warnings; use Moose 0.94 (); use Moose::Exporter; use Moose::Util::MetaRole; use MooseX::SemiAffordanceAccessor::Role::Attribute; my %metaroles = ( class_metaroles => { attribute => ['MooseX::SemiAffordanceAccessor::Role::Attribute'], }, ); $metaroles{role_metaroles} = { applied_attribute => ['MooseX::SemiAffordanceAccessor::Role::Attribute'], } if $Moose::VERSION >= 1.9900; Moose::Exporter->setup_import_methods(%metaroles); 1; # ABSTRACT: Name your accessors foo() and set_foo() =pod =head1 NAME MooseX::SemiAffordanceAccessor - Name your accessors foo() and set_foo() =head1 VERSION version 0.09 =head1 SYNOPSIS use Moose; use MooseX::SemiAffordanceAccessor; # make some attributes =head1 DESCRIPTION This module does not provide any methods. Simply loading it changes the default naming policy for the loading class so that accessors are separated into get and set methods. The get methods have the same name as the accessor, while set methods are prefixed with "set_". If you define an attribute with a leading underscore, then the set method will start with "_set_". If you explicitly set a "reader" or "writer" name when creating an attribute, then that attribute's naming scheme is left unchanged. The name "semi-affordance" comes from David Wheeler's Class::Meta module. =head1 ACCESSORS IN ROLES Prior to version 1.9900 of L, attributes added to a class ended up with that class's attribute traits. That means that if your class used C, any attributes provided by roles you consumed had the semi-affordance style of accessor. As of Moose 1.9900, that is no longer the case. Attributes provided by roles no longer acquire the consuming class's attribute traits. However, with Moose 1.9900+, you can now use C directly in roles. Attributes defined by that role will have semi-affordance style accessors, regardless of what attribute traits the consuming class has. =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) 2011 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) =cut __END__ Role000755001750001750 011532246050 26575 5ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/lib/MooseX/SemiAffordanceAccessorAttribute.pm000644001750001750 306011532246050 31234 0ustar00autarchautarch000000000000MooseX-SemiAffordanceAccessor-0.09/lib/MooseX/SemiAffordanceAccessor/Rolepackage MooseX::SemiAffordanceAccessor::Role::Attribute; BEGIN { $MooseX::SemiAffordanceAccessor::Role::Attribute::VERSION = '0.09'; } use strict; use warnings; use Moose::Role; before '_process_options' => sub { my $class = shift; my $name = shift; my $options = shift; if ( exists $options->{is} && !( exists $options->{reader} || exists $options->{writer} ) ) { if ( $options->{is} eq 'ro' ) { $options->{reader} = $name; delete $options->{is}; } elsif ( $options->{is} eq 'rw' ) { $options->{reader} = $name; my $prefix = 'set'; if ( $name =~ s/^_// ) { $prefix = '_set'; } $options->{writer} = $prefix . q{_} . $name; delete $options->{is}; } } }; no Moose::Role; 1; __END__ =pod =head1 NAME MooseX::SemiAffordanceAccessor::Role::Attribute =head1 VERSION version 0.09 =head1 SYNOPSIS Moose::Util::MetaRole::apply_metaclass_roles( for_class => $p{for_class}, attribute_metaclass_roles => ['MooseX::SemiAffordanceAccessor::Role::Attribute'], ); =head1 DESCRIPTION This role applies a method modifier to the C<_process_options()> method, and tweaks the reader and writer parameters so that they follow the semi-affordance naming style. =head1 AUTHOR Dave Rolsky =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2011 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) =cut