@@ -0,0 +1,25 @@
+language: perl
+perl:
+ - "5.8"
+ - "5.10"
+ - "5.12"
+ - "5.14"
+ - "5.16"
+ - "5.18"
+
+matrix:
+ allow_failures:
+ - perl: "5.8"
+
+before_install:
+ # git bits sometimes needed...
+ - git config user.name 'Travis-CI'
+ - git config user.email 'travis@nowhere.dne'
+
+install:
+ # not so much install our package as all its prereqs
+ - cpanm --installdeps . || { cat ~/.cpanm/build.log ; false ; }
+
+script:
+ - perl Makefile.PL
+ - make test
@@ -1,5 +1,63 @@
Revision history for MooseX-AttributeShortcuts
+0.028 2015-04-07 20:45:00 PDT-0700
+ * 0.028. *le sigh*
+
+0.027_02 2015-04-07 20:43:17 PDT-0700
+ * Moose 1.14 is now the minimum supported Moose.
+
+0.027_01 2015-03-28 22:02:17 PDT-0700
+ * Break out our $_process_options into more... succinct... methods.
+ * Add Moo-style type constraints.
+
+0.027 2015-03-10 19:27:06 PDT-0700
+ * Stop using autobox, after relentless persecution by The Cabal ;)
+ * Push out our warnings for those using undocumented bits, as we haven't
+ released a non-dev/trial version in *ages*
+
+0.026-TRIAL 2014-12-02 19:52:59 PST-0800
+ * Keep our comments dumb, even in tests. (thanks, @haarg!)
+
+0.025-TRIAL 2014-05-22 12:51:25 PDT-0700
+ * This is a TRIAL release, as I'm not entirely sure of the wisdom and
+ implementation of the following.
+ * Allow for the creation of additional associated methods by hijacking the
+ delegation system, a la native traits: handles => { ... => sub { ... } }
+
+0.024 2014-05-02 12:50:57 PDT-0700
+ * Make the undocumented isa_* options "deprecated" ...which seems like
+ better karma than no warning, as people really shouldn't be using these
+ anyways, but better nice than to have it done to me someday :)
+
+0.023 2014-04-04 21:23:33 PDT-0700
+ * Add isa_instance_of attribute option.
+
+0.022 2013-09-29 00:08:39 PDT-0700
+ * No code changes -- released with refreshed test suite
+
+0.021 2013-09-08 23:32:09 PDT-0700
+ * Drop MXCPA entirely, and incorporate the subtyping functionality
+
+0.020_01 2013-08-26 13:33:44 PDT-0700
+ * Keep MXCPA quiet, for now. This is evil (hence the dev release), but
+ should keep things status-quo until we properly integrate MXCPA
+ functionality into MXAS proper.
+
+0.020 2013-08-19 21:51:02 PDT-0700
+ * Bump CoercePerAttribute version requirement to 1.000 and update docs
+
+0.019 2013-04-20 21:50:05 PDT-0700
+ * Better support inline subtyping and coercions (people who are inclined
+ to shoot themselves in their foot will do it regardless)
+ * Additional tests for coercions
+
+0.018 2013-01-09 10:20:25 PST8PDT
+ * ~~ TRIAL ~~
+ * If a constraint coderef is given and coercion is requested, we now copy
+ the parent type's coercions to the anonymous child type.
+ * Better document the constraint option and how it interacts with simple
+ coercion.
+
0.017 2012-10-28 20:53:52 PST8PDT
* make actually make classes immutable during tests
* add initial primitive anonymous inline subtyping support; this needs to
@@ -1,44 +0,0 @@
-
-This is the Perl distribution MooseX-AttributeShortcuts.
-
-Installing MooseX-AttributeShortcuts is straightforward.
-
-## Installation with cpanm
-
-If you have cpanm, you only need one line:
-
- % cpanm MooseX::AttributeShortcuts
-
-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::AttributeShortcuts
-
-## Installing with the CPAN shell
-
-Alternatively, if your CPAN shell is set up, you should just be able to do:
-
- % cpan MooseX::AttributeShortcuts
-
-## 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-AttributeShortcuts documentation is available as POD.
-You can run perldoc from a shell to read the documentation:
-
- % perldoc MooseX::AttributeShortcuts
@@ -10,7 +10,7 @@ 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
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -1,5 +1,6 @@
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.034.
+.travis.yml
Changes
-INSTALL
LICENSE
MANIFEST
META.json
@@ -7,8 +8,10 @@ META.yml
Makefile.PL
README
SIGNATURE
+cpanfile
dist.ini
lib/MooseX/AttributeShortcuts.pm
+t/00-check-deps.t
t/00-compile.t
t/000-report-versions-tiny.t
t/01-basic.t
@@ -19,15 +22,24 @@ t/05-extend.t
t/06-role.t
t/07-trigger.t
t/anon-builder.t
+t/constraint.t
+t/deprecated/inline_typing.t
t/funcs.pm
+t/handles-coderef.t
t/handles-metaclass.t
+t/inline_coercion-back-compat.t
+t/inline_coercion.t
t/inline_subtyping.t
-t/inline_typing.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/inline_subtyping_with_coercion.t
+t/isa-mooish.t
+t/isa_instance_of.t
+xt/author/eol.t
+xt/author/no-tabs.t
+xt/author/pod-spell.t
+xt/release/consistent-version.t
+xt/release/has-version.t
+xt/release/minimum-version.t
+xt/release/no-smart-comments.t
+xt/release/pod-coverage.t
+xt/release/pod-linkcheck.t
+xt/release/pod-syntax.t
@@ -4,7 +4,7 @@
"Chris Weyl <cweyl@alumni.drew.edu>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 4.300028, CPAN::Meta::Converter version 2.120921",
+ "generated_by" : "Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.150001",
"license" : [
"lgpl_2_1"
],
@@ -22,26 +22,36 @@
"prereqs" : {
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : "6.30"
+ "ExtUtils::MakeMaker" : "0",
+ "perl" : "5.006"
}
},
"develop" : {
"requires" : {
"Pod::Coverage::TrustPod" : "0",
+ "Test::EOL" : "0",
+ "Test::More" : "0.88",
+ "Test::NoTabs" : "0",
"Test::Pod" : "1.41",
"Test::Pod::Coverage" : "1.08",
+ "Test::Spelling" : "0.12",
"version" : "0.9901"
}
},
"runtime" : {
"requires" : {
- "Moose" : "0",
+ "List::AllUtils" : "0",
+ "Moose" : "1.14",
"Moose::Exporter" : "0",
+ "Moose::Meta::TypeConstraint" : "0",
"Moose::Util::MetaRole" : "0",
"Moose::Util::TypeConstraints" : "0",
+ "MooseX::Meta::TypeConstraint::Mooish" : "0",
"MooseX::Role::Parameterized" : "0",
"MooseX::Types::Common::String" : "0",
"MooseX::Types::Moose" : "0",
+ "Package::DeprecationManager" : "0",
+ "aliased" : "0",
"namespace::autoclean" : "0",
"perl" : "5.006",
"strict" : "0",
@@ -50,25 +60,32 @@
},
"test" : {
"requires" : {
- "File::Find" : "0",
- "File::Temp" : "0",
+ "File::Spec" : "0",
+ "IO::Handle" : "0",
+ "IPC::Open3" : "0",
"Moose::Role" : "0",
+ "Moose::Util" : "0",
+ "MooseX::Types::Path::Class" : "0",
+ "Path::Class" : "0",
+ "Test::CheckDeps" : "0.010",
"Test::Fatal" : "0",
"Test::Moose" : "0",
- "Test::Moose::More" : "0.017",
- "Test::More" : "0.88",
- "constant" : "0"
+ "Test::Moose::More" : "0.018",
+ "Test::More" : "0.94",
+ "Test::Warn" : "0",
+ "constant" : "0",
+ "perl" : "5.006"
}
}
},
"provides" : {
"MooseX::AttributeShortcuts" : {
"file" : "lib/MooseX/AttributeShortcuts.pm",
- "version" : "0.017"
+ "version" : "0.028"
},
"MooseX::AttributeShortcuts::Trait::Attribute" : {
"file" : "lib/MooseX/AttributeShortcuts.pm",
- "version" : "0.017"
+ "version" : "0.028"
}
},
"release_status" : "stable",
@@ -76,303 +93,779 @@
"bugtracker" : {
"web" : "https://github.com/RsrchBoy/moosex-attributeshortcuts/issues"
},
- "homepage" : "http://metacpan.org/release/MooseX-AttributeShortcuts/",
+ "homepage" : "https://github.com/RsrchBoy/moosex-attributeshortcuts",
"repository" : {
"type" : "git",
- "url" : "git://github.com/RsrchBoy/moosex-attributeshortcuts.git",
+ "url" : "https://github.com/RsrchBoy/moosex-attributeshortcuts.git",
"web" : "https://github.com/RsrchBoy/moosex-attributeshortcuts"
}
},
- "version" : "0.017",
+ "version" : "0.028",
"x_Dist_Zilla" : {
"perl" : {
- "version" : "5.016001"
+ "version" : "5.020001"
},
"plugins" : [
{
"class" : "Dist::Zilla::Plugin::NextRelease",
- "name" : "@Filter/Dist::Zilla::Plugin::NextRelease",
- "version" : "4.300028"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Check",
- "name" : "@Filter/@Git/Check",
- "version" : "2.001"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Commit",
- "name" : "@Filter/@Git/Commit",
- "version" : "2.001"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Tag",
- "name" : "@Filter/@Git/Tag",
- "version" : "2.001"
+ "name" : "@RSRCHBOY/NextRelease",
+ "version" : "5.034"
},
{
- "class" : "Dist::Zilla::Plugin::Git::Push",
- "name" : "@Filter/@Git/Push",
- "version" : "2.001"
+ "class" : "Dist::Zilla::Plugin::Git::NextVersion",
+ "config" : {
+ "Dist::Zilla::Plugin::Git::NextVersion" : {
+ "first_version" : "0.001",
+ "version_by_branch" : "0",
+ "version_regexp" : "(?^:^(\\d.\\d+(_\\d\\d)?)(-TRIAL|)$)"
+ },
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/Git::NextVersion",
+ "version" : "2.033"
},
{
- "class" : "Dist::Zilla::Plugin::Git::NextVersion",
- "name" : "@Filter/Dist::Zilla::Plugin::Git::NextVersion",
- "version" : "2.001"
+ "class" : "Dist::Zilla::Plugin::ContributorsFromGit",
+ "name" : "@RSRCHBOY/ContributorsFromGit",
+ "version" : "0.016"
},
{
"class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch",
- "name" : "@Filter/@Git::CheckFor/Git::CheckFor::CorrectBranch",
- "version" : "0.005"
+ "config" : {
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::CorrectBranch",
+ "version" : "0.013"
},
{
"class" : "Dist::Zilla::Plugin::Git::CheckFor::Fixups",
- "name" : "@Filter/@Git::CheckFor/Git::CheckFor::Fixups",
- "version" : "0.005"
+ "config" : {
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::Fixups",
+ "version" : "0.013"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts",
+ "config" : {
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/@Git::CheckFor/Git::CheckFor::MergeConflicts",
+ "version" : "0.013"
},
{
"class" : "Dist::Zilla::Plugin::GatherDir",
- "name" : "@Filter/Dist::Zilla::Plugin::GatherDir",
- "version" : "4.300028"
+ "config" : {
+ "Dist::Zilla::Plugin::GatherDir" : {
+ "exclude_filename" : [
+ "LICENSE",
+ "cpanfile"
+ ],
+ "exclude_match" : [],
+ "follow_symlinks" : "0",
+ "include_dotfiles" : "0",
+ "prefix" : "",
+ "prune_directory" : [],
+ "root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/GatherDir",
+ "version" : "5.034"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::PromptIfStale",
+ "config" : {
+ "Dist::Zilla::Plugin::PromptIfStale" : {
+ "check_all_plugins" : 0,
+ "check_all_prereqs" : 0,
+ "modules" : [
+ "Dist::Zilla",
+ "Dist::Zilla::PluginBundle::RSRCHBOY"
+ ],
+ "phase" : "build",
+ "skip" : []
+ }
+ },
+ "name" : "@RSRCHBOY/PromptIfStale",
+ "version" : "0.040"
},
{
"class" : "Dist::Zilla::Plugin::PruneCruft",
- "name" : "@Filter/Dist::Zilla::Plugin::PruneCruft",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/PruneCruft",
+ "version" : "5.034"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Describe",
+ "name" : "@RSRCHBOY/Git::Describe",
+ "version" : "0.005"
},
{
"class" : "Dist::Zilla::Plugin::ExecDir",
- "name" : "@Filter/Dist::Zilla::Plugin::ExecDir",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/ExecDir",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::ShareDir",
- "name" : "@Filter/Dist::Zilla::Plugin::ShareDir",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/ShareDir",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::MakeMaker",
- "name" : "@Filter/Dist::Zilla::Plugin::MakeMaker",
- "version" : "4.300028"
- },
- {
- "class" : "Dist::Zilla::Plugin::InstallGuide",
- "name" : "@Filter/Dist::Zilla::Plugin::InstallGuide",
- "version" : "1.200000"
+ "config" : {
+ "Dist::Zilla::Role::TestRunner" : {
+ "default_jobs" : 1
+ }
+ },
+ "name" : "@RSRCHBOY/MakeMaker",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::Manifest",
- "name" : "@Filter/Dist::Zilla::Plugin::Manifest",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/Manifest",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::SurgicalPkgVersion",
- "name" : "@Filter/Dist::Zilla::Plugin::SurgicalPkgVersion",
+ "name" : "@RSRCHBOY/SurgicalPkgVersion",
"version" : "0.0019"
},
{
- "class" : "Dist::Zilla::Plugin::ReadmeFromPod",
- "name" : "@Filter/Dist::Zilla::Plugin::ReadmeFromPod",
- "version" : "0.16"
- },
- {
"class" : "Dist::Zilla::Plugin::MinimumPerl",
- "name" : "@Filter/Dist::Zilla::Plugin::MinimumPerl",
- "version" : "1.003"
+ "name" : "@RSRCHBOY/MinimumPerl",
+ "version" : "1.006"
},
{
"class" : "Dist::Zilla::Plugin::ReportVersions::Tiny",
- "name" : "@Filter/Dist::Zilla::Plugin::ReportVersions::Tiny",
- "version" : "1.08"
+ "name" : "@RSRCHBOY/ReportVersions::Tiny",
+ "version" : "1.10"
},
{
"class" : "Dist::Zilla::Plugin::AutoPrereqs",
- "name" : "@Filter/Dist::Zilla::Plugin::AutoPrereqs",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/AutoPrereqs",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::Prepender",
- "name" : "@Filter/Dist::Zilla::Plugin::Prepender",
- "version" : "1.112280"
+ "name" : "@RSRCHBOY/Prepender",
+ "version" : "2.001"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Test::PodSpelling",
+ "name" : "@RSRCHBOY/Test::PodSpelling",
+ "version" : "2.006008"
},
{
"class" : "Dist::Zilla::Plugin::ConsistentVersionTest",
- "name" : "@Filter/Dist::Zilla::Plugin::ConsistentVersionTest",
+ "name" : "@RSRCHBOY/ConsistentVersionTest",
"version" : "0.02"
},
{
"class" : "Dist::Zilla::Plugin::PodCoverageTests",
- "name" : "@Filter/Dist::Zilla::Plugin::PodCoverageTests",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/PodCoverageTests",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::PodSyntaxTests",
- "name" : "@Filter/Dist::Zilla::Plugin::PodSyntaxTests",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/PodSyntaxTests",
+ "version" : "5.034"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Test::NoTabs",
+ "config" : {
+ "Dist::Zilla::Plugin::Test::NoTabs" : {
+ "filename" : "xt/author/no-tabs.t",
+ "finder" : [
+ ":InstallModules",
+ ":ExecFiles",
+ ":TestFiles"
+ ]
+ }
+ },
+ "name" : "@RSRCHBOY/Test::NoTabs",
+ "version" : "0.13"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Test::EOL",
+ "config" : {
+ "Dist::Zilla::Plugin::Test::EOL" : {
+ "filename" : "xt/author/eol.t",
+ "finder" : [
+ ":InstallModules",
+ ":ExecFiles",
+ ":TestFiles"
+ ],
+ "trailing_whitespace" : "1"
+ }
+ },
+ "name" : "@RSRCHBOY/Test::EOL",
+ "version" : "0.17"
},
{
- "class" : "Dist::Zilla::Plugin::NoTabsTests",
- "name" : "@Filter/Dist::Zilla::Plugin::NoTabsTests",
- "version" : "0.01"
+ "class" : "Dist::Zilla::Plugin::HasVersionTests",
+ "name" : "@RSRCHBOY/HasVersionTests",
+ "version" : "1.101420"
},
{
- "class" : "Dist::Zilla::Plugin::EOLTests",
- "name" : "@Filter/Dist::Zilla::Plugin::EOLTests",
- "version" : "0.02"
+ "class" : "Dist::Zilla::Plugin::Test::Compile",
+ "config" : {
+ "Dist::Zilla::Plugin::Test::Compile" : {
+ "bail_out_on_fail" : "0",
+ "fail_on_warning" : "author",
+ "fake_home" : "0",
+ "filename" : "t/00-compile.t",
+ "module_finder" : [
+ ":InstallModules"
+ ],
+ "needs_display" : "0",
+ "phase" : "test",
+ "script_finder" : [
+ ":ExecFiles"
+ ],
+ "skips" : []
+ }
+ },
+ "name" : "@RSRCHBOY/Test::Compile",
+ "version" : "2.052"
},
{
- "class" : "Dist::Zilla::Plugin::HasVersionTests",
- "name" : "@Filter/Dist::Zilla::Plugin::HasVersionTests",
- "version" : "1.101420"
+ "class" : "Dist::Zilla::Plugin::NoSmartCommentsTests",
+ "name" : "@RSRCHBOY/NoSmartCommentsTests",
+ "version" : "0.007"
},
{
- "class" : "Dist::Zilla::Plugin::Test::Compile",
- "name" : "@Filter/Dist::Zilla::Plugin::Test::Compile",
- "version" : "1.112820"
+ "class" : "Dist::Zilla::Plugin::Test::Pod::LinkCheck",
+ "name" : "@RSRCHBOY/Test::Pod::LinkCheck",
+ "version" : "1.001"
},
{
- "class" : "Dist::Zilla::Plugin::Test::Portability",
- "name" : "@Filter/Dist::Zilla::Plugin::Test::Portability",
- "version" : "2.000003"
+ "class" : "Dist::Zilla::Plugin::RunExtraTests",
+ "config" : {
+ "Dist::Zilla::Role::TestRunner" : {
+ "default_jobs" : 1
+ }
+ },
+ "name" : "@RSRCHBOY/RunExtraTests",
+ "version" : "0.026"
},
{
- "class" : "Dist::Zilla::Plugin::ExtraTests",
- "name" : "@Filter/Dist::Zilla::Plugin::ExtraTests",
- "version" : "4.300028"
+ "class" : "Dist::Zilla::Plugin::CheckExtraTests",
+ "name" : "@RSRCHBOY/CheckExtraTests",
+ "version" : "0.026"
},
{
- "class" : "Dist::Zilla::Plugin::NoSmartCommentsTests",
- "name" : "@Filter/Dist::Zilla::Plugin::NoSmartCommentsTests",
- "version" : "0.006"
+ "class" : "Dist::Zilla::Plugin::Test::MinimumVersion",
+ "name" : "@RSRCHBOY/Test::MinimumVersion",
+ "version" : "2.000006"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Authority",
+ "name" : "@RSRCHBOY/Authority",
+ "version" : "1.009"
},
{
"class" : "Dist::Zilla::Plugin::MetaConfig",
- "name" : "@Filter/Dist::Zilla::Plugin::MetaConfig",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/MetaConfig",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::MetaJSON",
- "name" : "@Filter/Dist::Zilla::Plugin::MetaJSON",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/MetaJSON",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::MetaYAML",
- "name" : "@Filter/Dist::Zilla::Plugin::MetaYAML",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/MetaYAML",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::MetaNoIndex",
- "name" : "@Filter/Dist::Zilla::Plugin::MetaNoIndex",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/MetaNoIndex",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::MetaProvides::Package",
- "name" : "@Filter/Dist::Zilla::Plugin::MetaProvides::Package",
- "version" : "1.14000001"
- },
- {
- "class" : "Dist::Zilla::Plugin::GitHub::Meta",
- "name" : "@Filter/Dist::Zilla::Plugin::GitHub::Meta",
- "version" : "0.27"
+ "config" : {
+ "Dist::Zilla::Plugin::MetaProvides::Package" : {
+ "finder_objects" : [
+ {
+ "class" : "Dist::Zilla::Plugin::FinderCode",
+ "name" : "@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM",
+ "version" : "5.034"
+ }
+ ]
+ },
+ "Dist::Zilla::Role::MetaProvider::Provider" : {
+ "inherit_missing" : "1",
+ "inherit_version" : "1",
+ "meta_noindex" : "1"
+ }
+ },
+ "name" : "@RSRCHBOY/MetaProvides::Package",
+ "version" : "2.003001"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::GithubMeta",
+ "name" : "@RSRCHBOY/GithubMeta",
+ "version" : "0.48"
},
{
"class" : "Dist::Zilla::Plugin::TestRelease",
- "name" : "@Filter/Dist::Zilla::Plugin::TestRelease",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/TestRelease",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::CheckChangesHasContent",
- "name" : "@Filter/Dist::Zilla::Plugin::CheckChangesHasContent",
- "version" : "0.006"
+ "name" : "@RSRCHBOY/CheckChangesHasContent",
+ "version" : "0.008"
},
{
"class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed",
- "name" : "@Filter/Dist::Zilla::Plugin::CheckPrereqsIndexed",
- "version" : "0.007"
+ "name" : "@RSRCHBOY/CheckPrereqsIndexed",
+ "version" : "0.015"
},
{
- "class" : "Dist::Zilla::Plugin::ConfirmRelease",
- "name" : "@Filter/Dist::Zilla::Plugin::ConfirmRelease",
- "version" : "4.300028"
+ "class" : "Dist::Zilla::Plugin::Git::Remote::Update",
+ "name" : "@RSRCHBOY/GitFetchOrigin",
+ "version" : "0.1.2"
},
{
- "class" : "Dist::Zilla::Plugin::GitHub::Update",
- "name" : "@Filter/Dist::Zilla::Plugin::GitHub::Update",
- "version" : "0.27"
+ "class" : "Dist::Zilla::Plugin::Git::Remote::Check",
+ "name" : "@RSRCHBOY/GitCheckReleaseBranchSync",
+ "version" : "0.1.2"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Remote::Check",
+ "name" : "@RSRCHBOY/GitCheckMasterBranchSync",
+ "version" : "0.1.2"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Check",
+ "config" : {
+ "Dist::Zilla::Plugin::Git::Check" : {
+ "untracked_files" : "die"
+ },
+ "Dist::Zilla::Role::Git::DirtyFiles" : {
+ "allow_dirty" : [
+ ".gitignore",
+ ".travis.yml",
+ "Changes",
+ "README.mkdn",
+ "dist.ini",
+ "weaver.ini",
+ "LICENSE",
+ "cpanfile"
+ ],
+ "allow_dirty_match" : [],
+ "changelog" : "Changes"
+ },
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/Git::Check",
+ "version" : "2.033"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Commit",
+ "config" : {
+ "Dist::Zilla::Plugin::Git::Commit" : {
+ "add_files_in" : [],
+ "commit_msg" : "v%v%n%n%c",
+ "time_zone" : "local"
+ },
+ "Dist::Zilla::Role::Git::DirtyFiles" : {
+ "allow_dirty" : [
+ ".gitignore",
+ ".travis.yml",
+ "Changes",
+ "README.mkdn",
+ "dist.ini",
+ "weaver.ini",
+ "LICENSE",
+ "cpanfile"
+ ],
+ "allow_dirty_match" : [],
+ "changelog" : "Changes"
+ },
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/Git::Commit",
+ "version" : "2.033"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Test::CheckDeps",
+ "name" : "@RSRCHBOY/Test::CheckDeps",
+ "version" : "0.012"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::CheckSelfDependency",
+ "config" : {
+ "Dist::Zilla::Plugin::CheckSelfDependency" : {
+ "finder" : [
+ ":InstallModules"
+ ]
+ },
+ "Dist::Zilla::Role::ModuleMetadata" : {
+ "Module::Metadata" : "1.000026",
+ "version" : "0.003"
+ }
+ },
+ "name" : "@RSRCHBOY/CheckSelfDependency",
+ "version" : "0.011"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Travis::ConfigForReleaseBranch",
+ "name" : "@RSRCHBOY/Travis::ConfigForReleaseBranch",
+ "version" : "0.001"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::SchwartzRatio",
+ "name" : "@RSRCHBOY/SchwartzRatio",
+ "version" : "0.2.0"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Tag",
+ "config" : {
+ "Dist::Zilla::Plugin::Git::Tag" : {
+ "branch" : null,
+ "signed" : "1",
+ "tag" : "0.028",
+ "tag_format" : "%v",
+ "tag_message" : "v%v",
+ "time_zone" : "local"
+ },
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/Git::Tag",
+ "version" : "2.033"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::CommitBuild",
+ "config" : {
+ "Dist::Zilla::Plugin::Git::CommitBuild" : {
+ "branch" : "build/%b",
+ "build_root" : null,
+ "message" : "Build results of %h (on %b)",
+ "multiple_inheritance" : 0,
+ "release_branch" : null,
+ "release_message" : "Build results of %h (on %b)"
+ },
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/Git::CommitBuild::Build",
+ "version" : "2.033"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::CommitBuild",
+ "config" : {
+ "Dist::Zilla::Plugin::Git::CommitBuild" : {
+ "branch" : "build/%b",
+ "build_root" : null,
+ "message" : "Build results of %h (on %b)",
+ "multiple_inheritance" : 1,
+ "release_branch" : "release/cpan",
+ "release_message" : "Full build of CPAN release %v%t"
+ },
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/Git::CommitBuild::Release",
+ "version" : "2.033"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Git::Push",
+ "config" : {
+ "Dist::Zilla::Plugin::Git::Push" : {
+ "push_to" : [
+ "origin",
+ "origin refs/heads/release/cpan:refs/heads/release/cpan"
+ ],
+ "remotes_must_exist" : 1
+ },
+ "Dist::Zilla::Role::Git::Repo" : {
+ "repo_root" : "."
+ }
+ },
+ "name" : "@RSRCHBOY/Git::Push",
+ "version" : "2.033"
},
{
"class" : "Dist::Zilla::Plugin::UploadToCPAN",
- "name" : "@Filter/Dist::Zilla::Plugin::UploadToCPAN",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/UploadToCPAN",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::Signature",
- "name" : "@Filter/Dist::Zilla::Plugin::Signature",
+ "name" : "@RSRCHBOY/Signature",
"version" : "1.100930"
},
{
"class" : "Dist::Zilla::Plugin::Twitter",
- "name" : "@Filter/Dist::Zilla::Plugin::Twitter",
- "version" : "0.017"
+ "name" : "@RSRCHBOY/Twitter",
+ "version" : "0.026"
},
{
"class" : "Dist::Zilla::Plugin::InstallRelease",
- "name" : "@Filter/Dist::Zilla::Plugin::InstallRelease",
+ "name" : "@RSRCHBOY/InstallRelease",
"version" : "0.008"
},
{
+ "class" : "Dist::Zilla::Plugin::GitHub::Update",
+ "name" : "@RSRCHBOY/GitHub::Update",
+ "version" : "0.40"
+ },
+ {
"class" : "Dist::Zilla::Plugin::ArchiveRelease",
- "name" : "@Filter/Dist::Zilla::Plugin::ArchiveRelease",
- "version" : "4.00"
+ "name" : "@RSRCHBOY/ArchiveRelease",
+ "version" : "4.26"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::ConfirmRelease",
+ "name" : "@RSRCHBOY/ConfirmRelease",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::License",
- "name" : "@Filter/Dist::Zilla::Plugin::License",
- "version" : "4.300028"
+ "name" : "@RSRCHBOY/License",
+ "version" : "5.034"
},
{
- "class" : "Dist::Zilla::Plugin::CopyFilesFromBuild",
- "name" : "@Filter/Dist::Zilla::Plugin::CopyFilesFromBuild",
- "version" : "0.103510"
+ "class" : "Dist::Zilla::Plugin::CPANFile",
+ "name" : "@RSRCHBOY/CPANFile",
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
- "name" : "@Filter/ReadmePodInRoot",
- "version" : "0.120120"
+ "name" : "@RSRCHBOY/ReadmeMarkdownInRoot",
+ "version" : "0.150250"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
+ "name" : "@RSRCHBOY/ReadmeTxt",
+ "version" : "0.150250"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::CopyFilesFromBuild",
+ "name" : "@RSRCHBOY/CopyFilesFromBuild",
+ "version" : "0.150250"
},
{
"class" : "Dist::Zilla::Plugin::PodWeaver",
- "name" : "@Filter/Dist::Zilla::Plugin::PodWeaver",
- "version" : "3.101641"
+ "config" : {
+ "Dist::Zilla::Plugin::PodWeaver" : {
+ "config_plugins" : [
+ "@RSRCHBOY"
+ ],
+ "finder" : [
+ ":InstallModules",
+ ":ExecFiles"
+ ],
+ "plugins" : [
+ {
+ "class" : "Pod::Weaver::Plugin::StopWords",
+ "name" : "@RSRCHBOY/StopWords",
+ "version" : "1.010"
+ },
+ {
+ "class" : "Pod::Weaver::Plugin::EnsurePod5",
+ "name" : "@CorePrep/EnsurePod5",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Plugin::H1Nester",
+ "name" : "@CorePrep/H1Nester",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Name",
+ "name" : "@RSRCHBOY/Name",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Version",
+ "name" : "@RSRCHBOY/Version",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Region",
+ "name" : "@RSRCHBOY/prelude",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Generic",
+ "name" : "SYNOPSIS",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Generic",
+ "name" : "DESCRIPTION",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Generic",
+ "name" : "OVERVIEW",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::RSRCHBOY::RoleParameters",
+ "name" : "ROLE PARAMETERS",
+ "version" : "0.055"
+ },
+ {
+ "class" : "Pod::Weaver::Section::RSRCHBOY::RequiredAttributes",
+ "name" : "REQUIRED ATTRIBUTES",
+ "version" : "0.055"
+ },
+ {
+ "class" : "Pod::Weaver::Section::RSRCHBOY::LazyAttributes",
+ "name" : "LAZY ATTRIBUTES",
+ "version" : "0.055"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Collect",
+ "name" : "ATTRIBUTES",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Collect",
+ "name" : "METHODS",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Collect",
+ "name" : "REQUIRED METHODS",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Collect",
+ "name" : "FUNCTIONS",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Collect",
+ "name" : "TYPES",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Collect",
+ "name" : "TEST_FUNCTIONS",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Leftovers",
+ "name" : "@RSRCHBOY/Leftovers",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Region",
+ "name" : "@RSRCHBOY/postlude",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::SeeAlso",
+ "name" : "@RSRCHBOY/SeeAlso",
+ "version" : "1.003"
+ },
+ {
+ "class" : "Pod::Weaver::Section::SourceGitHub",
+ "name" : "@RSRCHBOY/SourceGitHub",
+ "version" : "0.54"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Bugs",
+ "name" : "@RSRCHBOY/Bugs",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Section::RSRCHBOY::Authors",
+ "name" : "RSRCHBOY::Authors",
+ "version" : "0.055"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Contributors",
+ "name" : "@RSRCHBOY/Contributors",
+ "version" : "0.009"
+ },
+ {
+ "class" : "Pod::Weaver::Section::Legal",
+ "name" : "@RSRCHBOY/Legal",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Plugin::Transformer",
+ "name" : "@RSRCHBOY/List",
+ "version" : "4.011"
+ },
+ {
+ "class" : "Pod::Weaver::Plugin::SingleEncoding",
+ "name" : "@RSRCHBOY/SingleEncoding",
+ "version" : "4.011"
+ }
+ ]
+ }
+ },
+ "name" : "@RSRCHBOY/PodWeaver",
+ "version" : "4.006"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":InstallModules",
- "version" : "4.300028"
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":IncModules",
- "version" : "4.300028"
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":TestFiles",
- "version" : "4.300028"
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExecFiles",
- "version" : "4.300028"
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ShareFiles",
- "version" : "4.300028"
+ "version" : "5.034"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":MainModule",
- "version" : "4.300028"
+ "version" : "5.034"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::FinderCode",
+ "name" : ":AllFiles",
+ "version" : "5.034"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::FinderCode",
+ "name" : ":NoFiles",
+ "version" : "5.034"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::FinderCode",
+ "name" : "@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM",
+ "version" : "5.034"
}
],
"zilla" : {
@@ -380,8 +873,13 @@
"config" : {
"is_trial" : "0"
},
- "version" : "4.300028"
+ "version" : "5.034"
}
- }
+ },
+ "x_authority" : "cpan:RSRCHBOY",
+ "x_contributors" : [
+ "David Steinbrunner <dsteinbrunner@pobox.com>",
+ "Graham Knop <haarg@haarg.org>"
+ ]
}
@@ -3,22 +3,30 @@ abstract: 'Shorthand for common attribute options'
author:
- 'Chris Weyl <cweyl@alumni.drew.edu>'
build_requires:
- File::Find: 0
- File::Temp: 0
- Moose::Role: 0
- Test::Fatal: 0
- Test::Moose: 0
- Test::Moose::More: 0.017
- Test::More: 0.88
- constant: 0
+ File::Spec: '0'
+ IO::Handle: '0'
+ IPC::Open3: '0'
+ Moose::Role: '0'
+ Moose::Util: '0'
+ MooseX::Types::Path::Class: '0'
+ Path::Class: '0'
+ Test::CheckDeps: '0.010'
+ Test::Fatal: '0'
+ Test::Moose: '0'
+ Test::Moose::More: '0.018'
+ Test::More: '0.94'
+ Test::Warn: '0'
+ constant: '0'
+ perl: '5.006'
configure_requires:
- ExtUtils::MakeMaker: 6.30
+ ExtUtils::MakeMaker: '0'
+ perl: '5.006'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.300028, CPAN::Meta::Converter version 2.120921'
+generated_by: 'Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.150001'
license: lgpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+ version: '1.4'
name: MooseX-AttributeShortcuts
no_index:
directory:
@@ -27,261 +35,632 @@ no_index:
provides:
MooseX::AttributeShortcuts:
file: lib/MooseX/AttributeShortcuts.pm
- version: 0.017
+ version: '0.028'
MooseX::AttributeShortcuts::Trait::Attribute:
file: lib/MooseX/AttributeShortcuts.pm
- version: 0.017
+ version: '0.028'
requires:
- Moose: 0
- Moose::Exporter: 0
- Moose::Util::MetaRole: 0
- Moose::Util::TypeConstraints: 0
- MooseX::Role::Parameterized: 0
- MooseX::Types::Common::String: 0
- MooseX::Types::Moose: 0
- namespace::autoclean: 0
- perl: 5.006
- strict: 0
- warnings: 0
+ List::AllUtils: '0'
+ Moose: '1.14'
+ Moose::Exporter: '0'
+ Moose::Meta::TypeConstraint: '0'
+ Moose::Util::MetaRole: '0'
+ Moose::Util::TypeConstraints: '0'
+ MooseX::Meta::TypeConstraint::Mooish: '0'
+ MooseX::Role::Parameterized: '0'
+ MooseX::Types::Common::String: '0'
+ MooseX::Types::Moose: '0'
+ Package::DeprecationManager: '0'
+ aliased: '0'
+ namespace::autoclean: '0'
+ perl: '5.006'
+ strict: '0'
+ warnings: '0'
resources:
bugtracker: https://github.com/RsrchBoy/moosex-attributeshortcuts/issues
- homepage: http://metacpan.org/release/MooseX-AttributeShortcuts/
- repository: git://github.com/RsrchBoy/moosex-attributeshortcuts.git
-version: 0.017
+ homepage: https://github.com/RsrchBoy/moosex-attributeshortcuts
+ repository: https://github.com/RsrchBoy/moosex-attributeshortcuts.git
+version: '0.028'
x_Dist_Zilla:
perl:
- version: 5.016001
+ version: '5.020001'
plugins:
-
class: Dist::Zilla::Plugin::NextRelease
- name: '@Filter/Dist::Zilla::Plugin::NextRelease'
- version: 4.300028
- -
- class: Dist::Zilla::Plugin::Git::Check
- name: '@Filter/@Git/Check'
- version: 2.001
- -
- class: Dist::Zilla::Plugin::Git::Commit
- name: '@Filter/@Git/Commit'
- version: 2.001
- -
- class: Dist::Zilla::Plugin::Git::Tag
- name: '@Filter/@Git/Tag'
- version: 2.001
- -
- class: Dist::Zilla::Plugin::Git::Push
- name: '@Filter/@Git/Push'
- version: 2.001
+ name: '@RSRCHBOY/NextRelease'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::Git::NextVersion
- name: '@Filter/Dist::Zilla::Plugin::Git::NextVersion'
- version: 2.001
+ config:
+ Dist::Zilla::Plugin::Git::NextVersion:
+ first_version: '0.001'
+ version_by_branch: '0'
+ version_regexp: (?^:^(\d.\d+(_\d\d)?)(-TRIAL|)$)
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/Git::NextVersion'
+ version: '2.033'
+ -
+ class: Dist::Zilla::Plugin::ContributorsFromGit
+ name: '@RSRCHBOY/ContributorsFromGit'
+ version: '0.016'
-
class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch
- name: '@Filter/@Git::CheckFor/Git::CheckFor::CorrectBranch'
- version: 0.005
+ config:
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::CorrectBranch'
+ version: '0.013'
-
class: Dist::Zilla::Plugin::Git::CheckFor::Fixups
- name: '@Filter/@Git::CheckFor/Git::CheckFor::Fixups'
- version: 0.005
+ config:
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::Fixups'
+ version: '0.013'
+ -
+ class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts
+ config:
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/@Git::CheckFor/Git::CheckFor::MergeConflicts'
+ version: '0.013'
-
class: Dist::Zilla::Plugin::GatherDir
- name: '@Filter/Dist::Zilla::Plugin::GatherDir'
- version: 4.300028
+ config:
+ Dist::Zilla::Plugin::GatherDir:
+ exclude_filename:
+ - LICENSE
+ - cpanfile
+ exclude_match: []
+ follow_symlinks: '0'
+ include_dotfiles: '0'
+ prefix: ''
+ prune_directory: []
+ root: .
+ name: '@RSRCHBOY/GatherDir'
+ version: '5.034'
+ -
+ class: Dist::Zilla::Plugin::PromptIfStale
+ config:
+ Dist::Zilla::Plugin::PromptIfStale:
+ check_all_plugins: 0
+ check_all_prereqs: 0
+ modules:
+ - Dist::Zilla
+ - Dist::Zilla::PluginBundle::RSRCHBOY
+ phase: build
+ skip: []
+ name: '@RSRCHBOY/PromptIfStale'
+ version: '0.040'
-
class: Dist::Zilla::Plugin::PruneCruft
- name: '@Filter/Dist::Zilla::Plugin::PruneCruft'
- version: 4.300028
+ name: '@RSRCHBOY/PruneCruft'
+ version: '5.034'
+ -
+ class: Dist::Zilla::Plugin::Git::Describe
+ name: '@RSRCHBOY/Git::Describe'
+ version: '0.005'
-
class: Dist::Zilla::Plugin::ExecDir
- name: '@Filter/Dist::Zilla::Plugin::ExecDir'
- version: 4.300028
+ name: '@RSRCHBOY/ExecDir'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::ShareDir
- name: '@Filter/Dist::Zilla::Plugin::ShareDir'
- version: 4.300028
+ name: '@RSRCHBOY/ShareDir'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::MakeMaker
- name: '@Filter/Dist::Zilla::Plugin::MakeMaker'
- version: 4.300028
- -
- class: Dist::Zilla::Plugin::InstallGuide
- name: '@Filter/Dist::Zilla::Plugin::InstallGuide'
- version: 1.200000
+ config:
+ Dist::Zilla::Role::TestRunner:
+ default_jobs: 1
+ name: '@RSRCHBOY/MakeMaker'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::Manifest
- name: '@Filter/Dist::Zilla::Plugin::Manifest'
- version: 4.300028
+ name: '@RSRCHBOY/Manifest'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::SurgicalPkgVersion
- name: '@Filter/Dist::Zilla::Plugin::SurgicalPkgVersion'
- version: 0.0019
- -
- class: Dist::Zilla::Plugin::ReadmeFromPod
- name: '@Filter/Dist::Zilla::Plugin::ReadmeFromPod'
- version: 0.16
+ name: '@RSRCHBOY/SurgicalPkgVersion'
+ version: '0.0019'
-
class: Dist::Zilla::Plugin::MinimumPerl
- name: '@Filter/Dist::Zilla::Plugin::MinimumPerl'
- version: 1.003
+ name: '@RSRCHBOY/MinimumPerl'
+ version: '1.006'
-
class: Dist::Zilla::Plugin::ReportVersions::Tiny
- name: '@Filter/Dist::Zilla::Plugin::ReportVersions::Tiny'
- version: 1.08
+ name: '@RSRCHBOY/ReportVersions::Tiny'
+ version: '1.10'
-
class: Dist::Zilla::Plugin::AutoPrereqs
- name: '@Filter/Dist::Zilla::Plugin::AutoPrereqs'
- version: 4.300028
+ name: '@RSRCHBOY/AutoPrereqs'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::Prepender
- name: '@Filter/Dist::Zilla::Plugin::Prepender'
- version: 1.112280
+ name: '@RSRCHBOY/Prepender'
+ version: '2.001'
+ -
+ class: Dist::Zilla::Plugin::Test::PodSpelling
+ name: '@RSRCHBOY/Test::PodSpelling'
+ version: '2.006008'
-
class: Dist::Zilla::Plugin::ConsistentVersionTest
- name: '@Filter/Dist::Zilla::Plugin::ConsistentVersionTest'
- version: 0.02
+ name: '@RSRCHBOY/ConsistentVersionTest'
+ version: '0.02'
-
class: Dist::Zilla::Plugin::PodCoverageTests
- name: '@Filter/Dist::Zilla::Plugin::PodCoverageTests'
- version: 4.300028
+ name: '@RSRCHBOY/PodCoverageTests'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::PodSyntaxTests
- name: '@Filter/Dist::Zilla::Plugin::PodSyntaxTests'
- version: 4.300028
- -
- class: Dist::Zilla::Plugin::NoTabsTests
- name: '@Filter/Dist::Zilla::Plugin::NoTabsTests'
- version: 0.01
- -
- class: Dist::Zilla::Plugin::EOLTests
- name: '@Filter/Dist::Zilla::Plugin::EOLTests'
- version: 0.02
+ name: '@RSRCHBOY/PodSyntaxTests'
+ version: '5.034'
+ -
+ class: Dist::Zilla::Plugin::Test::NoTabs
+ config:
+ Dist::Zilla::Plugin::Test::NoTabs:
+ filename: xt/author/no-tabs.t
+ finder:
+ - ':InstallModules'
+ - ':ExecFiles'
+ - ':TestFiles'
+ name: '@RSRCHBOY/Test::NoTabs'
+ version: '0.13'
+ -
+ class: Dist::Zilla::Plugin::Test::EOL
+ config:
+ Dist::Zilla::Plugin::Test::EOL:
+ filename: xt/author/eol.t
+ finder:
+ - ':InstallModules'
+ - ':ExecFiles'
+ - ':TestFiles'
+ trailing_whitespace: '1'
+ name: '@RSRCHBOY/Test::EOL'
+ version: '0.17'
-
class: Dist::Zilla::Plugin::HasVersionTests
- name: '@Filter/Dist::Zilla::Plugin::HasVersionTests'
- version: 1.101420
+ name: '@RSRCHBOY/HasVersionTests'
+ version: '1.101420'
-
class: Dist::Zilla::Plugin::Test::Compile
- name: '@Filter/Dist::Zilla::Plugin::Test::Compile'
- version: 1.112820
+ config:
+ Dist::Zilla::Plugin::Test::Compile:
+ bail_out_on_fail: '0'
+ fail_on_warning: author
+ fake_home: '0'
+ filename: t/00-compile.t
+ module_finder:
+ - ':InstallModules'
+ needs_display: '0'
+ phase: test
+ script_finder:
+ - ':ExecFiles'
+ skips: []
+ name: '@RSRCHBOY/Test::Compile'
+ version: '2.052'
+ -
+ class: Dist::Zilla::Plugin::NoSmartCommentsTests
+ name: '@RSRCHBOY/NoSmartCommentsTests'
+ version: '0.007'
-
- class: Dist::Zilla::Plugin::Test::Portability
- name: '@Filter/Dist::Zilla::Plugin::Test::Portability'
- version: 2.000003
+ class: Dist::Zilla::Plugin::Test::Pod::LinkCheck
+ name: '@RSRCHBOY/Test::Pod::LinkCheck'
+ version: '1.001'
-
- class: Dist::Zilla::Plugin::ExtraTests
- name: '@Filter/Dist::Zilla::Plugin::ExtraTests'
- version: 4.300028
+ class: Dist::Zilla::Plugin::RunExtraTests
+ config:
+ Dist::Zilla::Role::TestRunner:
+ default_jobs: 1
+ name: '@RSRCHBOY/RunExtraTests'
+ version: '0.026'
-
- class: Dist::Zilla::Plugin::NoSmartCommentsTests
- name: '@Filter/Dist::Zilla::Plugin::NoSmartCommentsTests'
- version: 0.006
+ class: Dist::Zilla::Plugin::CheckExtraTests
+ name: '@RSRCHBOY/CheckExtraTests'
+ version: '0.026'
+ -
+ class: Dist::Zilla::Plugin::Test::MinimumVersion
+ name: '@RSRCHBOY/Test::MinimumVersion'
+ version: '2.000006'
+ -
+ class: Dist::Zilla::Plugin::Authority
+ name: '@RSRCHBOY/Authority'
+ version: '1.009'
-
class: Dist::Zilla::Plugin::MetaConfig
- name: '@Filter/Dist::Zilla::Plugin::MetaConfig'
- version: 4.300028
+ name: '@RSRCHBOY/MetaConfig'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::MetaJSON
- name: '@Filter/Dist::Zilla::Plugin::MetaJSON'
- version: 4.300028
+ name: '@RSRCHBOY/MetaJSON'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::MetaYAML
- name: '@Filter/Dist::Zilla::Plugin::MetaYAML'
- version: 4.300028
+ name: '@RSRCHBOY/MetaYAML'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::MetaNoIndex
- name: '@Filter/Dist::Zilla::Plugin::MetaNoIndex'
- version: 4.300028
+ name: '@RSRCHBOY/MetaNoIndex'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::MetaProvides::Package
- name: '@Filter/Dist::Zilla::Plugin::MetaProvides::Package'
- version: 1.14000001
- -
- class: Dist::Zilla::Plugin::GitHub::Meta
- name: '@Filter/Dist::Zilla::Plugin::GitHub::Meta'
- version: 0.27
+ config:
+ Dist::Zilla::Plugin::MetaProvides::Package:
+ finder_objects:
+ -
+ class: Dist::Zilla::Plugin::FinderCode
+ name: '@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM'
+ version: '5.034'
+ Dist::Zilla::Role::MetaProvider::Provider:
+ inherit_missing: '1'
+ inherit_version: '1'
+ meta_noindex: '1'
+ name: '@RSRCHBOY/MetaProvides::Package'
+ version: '2.003001'
+ -
+ class: Dist::Zilla::Plugin::GithubMeta
+ name: '@RSRCHBOY/GithubMeta'
+ version: '0.48'
-
class: Dist::Zilla::Plugin::TestRelease
- name: '@Filter/Dist::Zilla::Plugin::TestRelease'
- version: 4.300028
+ name: '@RSRCHBOY/TestRelease'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::CheckChangesHasContent
- name: '@Filter/Dist::Zilla::Plugin::CheckChangesHasContent'
- version: 0.006
+ name: '@RSRCHBOY/CheckChangesHasContent'
+ version: '0.008'
-
class: Dist::Zilla::Plugin::CheckPrereqsIndexed
- name: '@Filter/Dist::Zilla::Plugin::CheckPrereqsIndexed'
- version: 0.007
+ name: '@RSRCHBOY/CheckPrereqsIndexed'
+ version: '0.015'
-
- class: Dist::Zilla::Plugin::ConfirmRelease
- name: '@Filter/Dist::Zilla::Plugin::ConfirmRelease'
- version: 4.300028
+ class: Dist::Zilla::Plugin::Git::Remote::Update
+ name: '@RSRCHBOY/GitFetchOrigin'
+ version: 0.1.2
-
- class: Dist::Zilla::Plugin::GitHub::Update
- name: '@Filter/Dist::Zilla::Plugin::GitHub::Update'
- version: 0.27
+ class: Dist::Zilla::Plugin::Git::Remote::Check
+ name: '@RSRCHBOY/GitCheckReleaseBranchSync'
+ version: 0.1.2
+ -
+ class: Dist::Zilla::Plugin::Git::Remote::Check
+ name: '@RSRCHBOY/GitCheckMasterBranchSync'
+ version: 0.1.2
+ -
+ class: Dist::Zilla::Plugin::Git::Check
+ config:
+ Dist::Zilla::Plugin::Git::Check:
+ untracked_files: die
+ Dist::Zilla::Role::Git::DirtyFiles:
+ allow_dirty:
+ - .gitignore
+ - .travis.yml
+ - Changes
+ - README.mkdn
+ - dist.ini
+ - weaver.ini
+ - LICENSE
+ - cpanfile
+ allow_dirty_match: []
+ changelog: Changes
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/Git::Check'
+ version: '2.033'
+ -
+ class: Dist::Zilla::Plugin::Git::Commit
+ config:
+ Dist::Zilla::Plugin::Git::Commit:
+ add_files_in: []
+ commit_msg: v%v%n%n%c
+ time_zone: local
+ Dist::Zilla::Role::Git::DirtyFiles:
+ allow_dirty:
+ - .gitignore
+ - .travis.yml
+ - Changes
+ - README.mkdn
+ - dist.ini
+ - weaver.ini
+ - LICENSE
+ - cpanfile
+ allow_dirty_match: []
+ changelog: Changes
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/Git::Commit'
+ version: '2.033'
+ -
+ class: Dist::Zilla::Plugin::Test::CheckDeps
+ name: '@RSRCHBOY/Test::CheckDeps'
+ version: '0.012'
+ -
+ class: Dist::Zilla::Plugin::CheckSelfDependency
+ config:
+ Dist::Zilla::Plugin::CheckSelfDependency:
+ finder:
+ - ':InstallModules'
+ Dist::Zilla::Role::ModuleMetadata:
+ Module::Metadata: '1.000026'
+ version: '0.003'
+ name: '@RSRCHBOY/CheckSelfDependency'
+ version: '0.011'
+ -
+ class: Dist::Zilla::Plugin::Travis::ConfigForReleaseBranch
+ name: '@RSRCHBOY/Travis::ConfigForReleaseBranch'
+ version: '0.001'
+ -
+ class: Dist::Zilla::Plugin::SchwartzRatio
+ name: '@RSRCHBOY/SchwartzRatio'
+ version: 0.2.0
+ -
+ class: Dist::Zilla::Plugin::Git::Tag
+ config:
+ Dist::Zilla::Plugin::Git::Tag:
+ branch: ~
+ signed: '1'
+ tag: '0.028'
+ tag_format: '%v'
+ tag_message: v%v
+ time_zone: local
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/Git::Tag'
+ version: '2.033'
+ -
+ class: Dist::Zilla::Plugin::Git::CommitBuild
+ config:
+ Dist::Zilla::Plugin::Git::CommitBuild:
+ branch: build/%b
+ build_root: ~
+ message: 'Build results of %h (on %b)'
+ multiple_inheritance: 0
+ release_branch: ~
+ release_message: 'Build results of %h (on %b)'
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/Git::CommitBuild::Build'
+ version: '2.033'
+ -
+ class: Dist::Zilla::Plugin::Git::CommitBuild
+ config:
+ Dist::Zilla::Plugin::Git::CommitBuild:
+ branch: build/%b
+ build_root: ~
+ message: 'Build results of %h (on %b)'
+ multiple_inheritance: 1
+ release_branch: release/cpan
+ release_message: 'Full build of CPAN release %v%t'
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/Git::CommitBuild::Release'
+ version: '2.033'
+ -
+ class: Dist::Zilla::Plugin::Git::Push
+ config:
+ Dist::Zilla::Plugin::Git::Push:
+ push_to:
+ - origin
+ - 'origin refs/heads/release/cpan:refs/heads/release/cpan'
+ remotes_must_exist: 1
+ Dist::Zilla::Role::Git::Repo:
+ repo_root: .
+ name: '@RSRCHBOY/Git::Push'
+ version: '2.033'
-
class: Dist::Zilla::Plugin::UploadToCPAN
- name: '@Filter/Dist::Zilla::Plugin::UploadToCPAN'
- version: 4.300028
+ name: '@RSRCHBOY/UploadToCPAN'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::Signature
- name: '@Filter/Dist::Zilla::Plugin::Signature'
- version: 1.100930
+ name: '@RSRCHBOY/Signature'
+ version: '1.100930'
-
class: Dist::Zilla::Plugin::Twitter
- name: '@Filter/Dist::Zilla::Plugin::Twitter'
- version: 0.017
+ name: '@RSRCHBOY/Twitter'
+ version: '0.026'
-
class: Dist::Zilla::Plugin::InstallRelease
- name: '@Filter/Dist::Zilla::Plugin::InstallRelease'
- version: 0.008
+ name: '@RSRCHBOY/InstallRelease'
+ version: '0.008'
+ -
+ class: Dist::Zilla::Plugin::GitHub::Update
+ name: '@RSRCHBOY/GitHub::Update'
+ version: '0.40'
-
class: Dist::Zilla::Plugin::ArchiveRelease
- name: '@Filter/Dist::Zilla::Plugin::ArchiveRelease'
- version: 4.00
+ name: '@RSRCHBOY/ArchiveRelease'
+ version: '4.26'
+ -
+ class: Dist::Zilla::Plugin::ConfirmRelease
+ name: '@RSRCHBOY/ConfirmRelease'
+ version: '5.034'
-
class: Dist::Zilla::Plugin::License
- name: '@Filter/Dist::Zilla::Plugin::License'
- version: 4.300028
+ name: '@RSRCHBOY/License'
+ version: '5.034'
-
- class: Dist::Zilla::Plugin::CopyFilesFromBuild
- name: '@Filter/Dist::Zilla::Plugin::CopyFilesFromBuild'
- version: 0.103510
+ class: Dist::Zilla::Plugin::CPANFile
+ name: '@RSRCHBOY/CPANFile'
+ version: '5.034'
+ -
+ class: Dist::Zilla::Plugin::ReadmeAnyFromPod
+ name: '@RSRCHBOY/ReadmeMarkdownInRoot'
+ version: '0.150250'
-
class: Dist::Zilla::Plugin::ReadmeAnyFromPod
- name: '@Filter/ReadmePodInRoot'
- version: 0.120120
+ name: '@RSRCHBOY/ReadmeTxt'
+ version: '0.150250'
+ -
+ class: Dist::Zilla::Plugin::CopyFilesFromBuild
+ name: '@RSRCHBOY/CopyFilesFromBuild'
+ version: '0.150250'
-
class: Dist::Zilla::Plugin::PodWeaver
- name: '@Filter/Dist::Zilla::Plugin::PodWeaver'
- version: 3.101641
+ config:
+ Dist::Zilla::Plugin::PodWeaver:
+ config_plugins:
+ - '@RSRCHBOY'
+ finder:
+ - ':InstallModules'
+ - ':ExecFiles'
+ plugins:
+ -
+ class: Pod::Weaver::Plugin::StopWords
+ name: '@RSRCHBOY/StopWords'
+ version: '1.010'
+ -
+ class: Pod::Weaver::Plugin::EnsurePod5
+ name: '@CorePrep/EnsurePod5'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Plugin::H1Nester
+ name: '@CorePrep/H1Nester'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Name
+ name: '@RSRCHBOY/Name'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Version
+ name: '@RSRCHBOY/Version'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Region
+ name: '@RSRCHBOY/prelude'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Generic
+ name: SYNOPSIS
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Generic
+ name: DESCRIPTION
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Generic
+ name: OVERVIEW
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::RSRCHBOY::RoleParameters
+ name: 'ROLE PARAMETERS'
+ version: '0.055'
+ -
+ class: Pod::Weaver::Section::RSRCHBOY::RequiredAttributes
+ name: 'REQUIRED ATTRIBUTES'
+ version: '0.055'
+ -
+ class: Pod::Weaver::Section::RSRCHBOY::LazyAttributes
+ name: 'LAZY ATTRIBUTES'
+ version: '0.055'
+ -
+ class: Pod::Weaver::Section::Collect
+ name: ATTRIBUTES
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Collect
+ name: METHODS
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Collect
+ name: 'REQUIRED METHODS'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Collect
+ name: FUNCTIONS
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Collect
+ name: TYPES
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Collect
+ name: TEST_FUNCTIONS
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Leftovers
+ name: '@RSRCHBOY/Leftovers'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::Region
+ name: '@RSRCHBOY/postlude'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::SeeAlso
+ name: '@RSRCHBOY/SeeAlso'
+ version: '1.003'
+ -
+ class: Pod::Weaver::Section::SourceGitHub
+ name: '@RSRCHBOY/SourceGitHub'
+ version: '0.54'
+ -
+ class: Pod::Weaver::Section::Bugs
+ name: '@RSRCHBOY/Bugs'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Section::RSRCHBOY::Authors
+ name: RSRCHBOY::Authors
+ version: '0.055'
+ -
+ class: Pod::Weaver::Section::Contributors
+ name: '@RSRCHBOY/Contributors'
+ version: '0.009'
+ -
+ class: Pod::Weaver::Section::Legal
+ name: '@RSRCHBOY/Legal'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Plugin::Transformer
+ name: '@RSRCHBOY/List'
+ version: '4.011'
+ -
+ class: Pod::Weaver::Plugin::SingleEncoding
+ name: '@RSRCHBOY/SingleEncoding'
+ version: '4.011'
+ name: '@RSRCHBOY/PodWeaver'
+ version: '4.006'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
- version: 4.300028
+ version: '5.034'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':IncModules'
- version: 4.300028
+ version: '5.034'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
- version: 4.300028
+ version: '5.034'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
- version: 4.300028
+ version: '5.034'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
- version: 4.300028
+ version: '5.034'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':MainModule'
- version: 4.300028
+ version: '5.034'
+ -
+ class: Dist::Zilla::Plugin::FinderCode
+ name: ':AllFiles'
+ version: '5.034'
+ -
+ class: Dist::Zilla::Plugin::FinderCode
+ name: ':NoFiles'
+ version: '5.034'
+ -
+ class: Dist::Zilla::Plugin::FinderCode
+ name: '@RSRCHBOY/MetaProvides::Package/AUTOVIV/:InstallModulesPM'
+ version: '5.034'
zilla:
class: Dist::Zilla::Dist::Builder
config:
- is_trial: 0
- version: 4.300028
+ is_trial: '0'
+ version: '5.034'
+x_authority: cpan:RSRCHBOY
+x_contributors:
+ - 'David Steinbrunner <dsteinbrunner@pobox.com>'
+ - 'Graham Knop <haarg@haarg.org>'
@@ -1,69 +1,112 @@
-
+#
+# This file is part of MooseX-AttributeShortcuts
+#
+# 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
+#
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.034.
use strict;
use warnings;
use 5.006;
-use ExtUtils::MakeMaker 6.30;
-
-
+use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "Shorthand for common attribute options",
"AUTHOR" => "Chris Weyl <cweyl\@alumni.drew.edu>",
- "BUILD_REQUIRES" => {
- "File::Find" => 0,
- "File::Temp" => 0,
- "Moose::Role" => 0,
- "Test::Fatal" => 0,
- "Test::Moose" => 0,
- "Test::Moose::More" => "0.017",
- "Test::More" => "0.88",
- "constant" => 0
- },
"CONFIGURE_REQUIRES" => {
- "ExtUtils::MakeMaker" => "6.30"
+ "ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "MooseX-AttributeShortcuts",
"EXE_FILES" => [],
"LICENSE" => "lgpl",
+ "MIN_PERL_VERSION" => "5.006",
"NAME" => "MooseX::AttributeShortcuts",
"PREREQ_PM" => {
- "Moose" => 0,
+ "List::AllUtils" => 0,
+ "Moose" => "1.14",
"Moose::Exporter" => 0,
+ "Moose::Meta::TypeConstraint" => 0,
"Moose::Util::MetaRole" => 0,
"Moose::Util::TypeConstraints" => 0,
+ "MooseX::Meta::TypeConstraint::Mooish" => 0,
"MooseX::Role::Parameterized" => 0,
"MooseX::Types::Common::String" => 0,
"MooseX::Types::Moose" => 0,
+ "Package::DeprecationManager" => 0,
+ "aliased" => 0,
"namespace::autoclean" => 0,
"strict" => 0,
"warnings" => 0
},
- "VERSION" => "0.017",
+ "TEST_REQUIRES" => {
+ "File::Spec" => 0,
+ "IO::Handle" => 0,
+ "IPC::Open3" => 0,
+ "Moose::Role" => 0,
+ "Moose::Util" => 0,
+ "MooseX::Types::Path::Class" => 0,
+ "Path::Class" => 0,
+ "Test::CheckDeps" => "0.010",
+ "Test::Fatal" => 0,
+ "Test::Moose" => 0,
+ "Test::Moose::More" => "0.018",
+ "Test::More" => "0.94",
+ "Test::Warn" => 0,
+ "constant" => 0
+ },
+ "VERSION" => "0.028",
"test" => {
- "TESTS" => "t/*.t"
+ "TESTS" => "t/*.t t/deprecated/*.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};
- }
- }
+my %FallbackPrereqs = (
+ "ExtUtils::MakeMaker" => 0,
+ "File::Spec" => 0,
+ "IO::Handle" => 0,
+ "IPC::Open3" => 0,
+ "List::AllUtils" => 0,
+ "Moose" => "1.14",
+ "Moose::Exporter" => 0,
+ "Moose::Meta::TypeConstraint" => 0,
+ "Moose::Role" => 0,
+ "Moose::Util" => 0,
+ "Moose::Util::MetaRole" => 0,
+ "Moose::Util::TypeConstraints" => 0,
+ "MooseX::Meta::TypeConstraint::Mooish" => 0,
+ "MooseX::Role::Parameterized" => 0,
+ "MooseX::Types::Common::String" => 0,
+ "MooseX::Types::Moose" => 0,
+ "MooseX::Types::Path::Class" => 0,
+ "Package::DeprecationManager" => 0,
+ "Path::Class" => 0,
+ "Test::CheckDeps" => "0.010",
+ "Test::Fatal" => 0,
+ "Test::Moose" => 0,
+ "Test::Moose::More" => "0.018",
+ "Test::More" => "0.94",
+ "Test::Warn" => 0,
+ "aliased" => 0,
+ "constant" => 0,
+ "namespace::autoclean" => 0,
+ "strict" => 0,
+ "warnings" => 0
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
+ delete $WriteMakefileArgs{TEST_REQUIRES};
+ delete $WriteMakefileArgs{BUILD_REQUIRES};
+ $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
-
-
-
@@ -1,49 +1,53 @@
NAME
+
MooseX::AttributeShortcuts - Shorthand for common attribute options
VERSION
- This document describes version 0.017 of MooseX::AttributeShortcuts -
- released October 28, 2012 as part of MooseX-AttributeShortcuts.
+
+ This document describes version 0.028 of MooseX::AttributeShortcuts -
+ released April 07, 2015 as part of MooseX-AttributeShortcuts.
SYNOPSIS
- package Some::Class;
+ package Some::Class;
+
use Moose;
use MooseX::AttributeShortcuts;
-
+
# same as:
# is => 'ro', lazy => 1, builder => '_build_foo'
has foo => (is => 'lazy');
-
+
# same as: is => 'ro', writer => '_set_foo'
has foo => (is => 'rwp');
-
+
# same as: is => 'ro', builder => '_build_bar'
has bar => (is => 'ro', builder => 1);
-
+
# same as: is => 'ro', clearer => 'clear_bar'
has bar => (is => 'ro', clearer => 1);
-
+
# same as: is => 'ro', predicate => 'has_bar'
has bar => (is => 'ro', predicate => 1);
-
+
# works as you'd expect for "private": predicate => '_has_bar'
has _bar => (is => 'ro', predicate => 1);
-
+
# extending? Use the "Shortcuts" trait alias
extends 'Some::OtherClass';
has '+bar' => (traits => [Shortcuts], builder => 1, ...);
-
+
# or...
package Some::Other::Class;
-
+
use Moose;
use MooseX::AttributeShortcuts -writer_prefix => '_';
-
+
# same as: is => 'ro', writer => '_foo'
has foo => (is => 'rwp');
DESCRIPTION
+
Ever find yourself repeatedly specifying writers and builders, because
there's no good shortcut to specifying them? Sometimes you want an
attribute to have a read-only public interface, but a private writer.
@@ -55,82 +59,109 @@ DESCRIPTION
processing to handle the above variations.
USAGE
+
This package automatically applies an attribute metaclass trait. Unless
you want to change the defaults, you can ignore the talk about
"prefixes" below.
EXTENDING A CLASS
- If you're extending a class and trying to extend its attributes as well,
- you'll find out that the trait is only applied to attributes defined
- locally in the class. This package exports a trait shortcut function
- "Shortcuts" that will help you apply this to the extended attribute:
+
+ If you're extending a class and trying to extend its attributes as
+ well, you'll find out that the trait is only applied to attributes
+ defined locally in the class. This package exports a trait shortcut
+ function "Shortcuts" that will help you apply this to the extended
+ attribute:
has '+something' => (traits => [Shortcuts], ...);
PREFIXES
+
We accept two parameters on the use of this module; they impact how
builders and writers are named.
- -writer_prefix
+ -writer_prefix
+
use MooseX::::AttributeShortcuts -writer_prefix => 'prefix';
- The default writer prefix is '_set_'. If you'd prefer it to be something
- else (say, '_'), this is where you'd do that.
+ The default writer prefix is '_set_'. If you'd prefer it to be
+ something else (say, '_'), this is where you'd do that.
+
+ -builder_prefix
- -builder_prefix
use MooseX::::AttributeShortcuts -builder_prefix => 'prefix';
The default builder prefix is '_build_', as this is what lazy_build
does, and what people in general recognize as build methods.
NEW ATTRIBUTE OPTIONS
- Unless specified here, all options defined by Moose::Meta::Attribute and
- Class::MOP::Attribute remain unchanged.
+
+ Unless specified here, all options defined by Moose::Meta::Attribute
+ and Class::MOP::Attribute remain unchanged.
Want to see additional options? Ask, or better yet, fork on GitHub and
- send a pull request. If the shortcuts you're asking for already exist in
- Moo or Mouse or elsewhere, please note that as it will carry significant
- weight.
+ send a pull request. If the shortcuts you're asking for already exist
+ in Moo or Mouse or elsewhere, please note that as it will carry
+ significant weight.
+
+ For the following, "$name" should be read as the attribute name; and
+ the various prefixes should be read using the defaults.
- For the following, "$name" should be read as the attribute name; and the
- various prefixes should be read using the defaults.
+ is => 'rwp'
- is => 'rwp'
- Specifying "is => 'rwp'" will cause the following options to be set:
+ Specifying is => 'rwp' will cause the following options to be set:
is => 'ro'
writer => "_set_$name"
- is => 'lazy'
- Specifying "is => 'lazy'" will cause the following options to be set:
+ is => 'lazy'
+
+ Specifying is => 'lazy' will cause the following options to be set:
is => 'ro'
builder => "_build_$name"
lazy => 1
- NOTE: Since 0.009 we no longer set "init_arg => undef" if no "init_arg"
- is explicitly provided. This is a change made in parallel with Moo,
- based on a large number of people surprised that lazy also made one's
- "init_def" undefined.
+ NOTE: Since 0.009 we no longer set init_arg => undef if no init_arg is
+ explicitly provided. This is a change made in parallel with Moo, based
+ on a large number of people surprised that lazy also made one's
+ init_def undefined.
+
+ is => 'lazy', default => ...
- is => 'lazy', default => ...
- Specifying "is => 'lazy'" and a default will cause the following options
+ Specifying is => 'lazy' and a default will cause the following options
to be set:
is => 'ro'
lazy => 1
default => ... # as provided
- That is, if you specify "is => 'lazy'" and also provide a "default",
- then we won't try to set a builder, as well.
+ That is, if you specify is => 'lazy' and also provide a default, then
+ we won't try to set a builder, as well.
+
+ builder => 1
- builder => 1
- Specifying "builder => 1" will cause the following options to be set:
+ Specifying builder => 1 will cause the following options to be set:
builder => "_build_$name"
- clearer => 1
- Specifying "clearer => 1" will cause the following options to be set:
+ builder => sub { ... }
+
+ Passing a coderef to builder will cause that coderef to be installed in
+ the class this attribute is associated with the name you'd expect, and
+ builder => 1 to be set.
+
+ e.g., in your class,
+
+ has foo => (is => 'ro', builder => sub { 'bar!' });
+
+ ...is effectively the same as...
+
+ has foo => (is => 'ro', builder => '_build_foo');
+ sub _build_foo { 'bar!' }
+
+ clearer => 1
+
+ Specifying clearer => 1 will cause the following options to be set:
clearer => "clear_$name"
@@ -140,8 +171,9 @@ NEW ATTRIBUTE OPTIONS
(that is, an attribute named "_foo" would get "_clear_foo")
- predicate => 1
- Specifying "predicate => 1" will cause the following options to be set:
+ predicate => 1
+
+ Specifying predicate => 1 will cause the following options to be set:
predicate => "has_$name"
@@ -151,8 +183,9 @@ NEW ATTRIBUTE OPTIONS
(that is, an attribute named "_foo" would get "_has_foo")
- trigger => 1
- Specifying "trigger => 1" will cause the attribute to be created with a
+ trigger => 1
+
+ Specifying trigger => 1 will cause the attribute to be created with a
trigger that calls a named method in the class with the options passed
to the trigger. By default, the method name the trigger calls is the
name of the attribute prefixed with "_trigger_".
@@ -168,26 +201,116 @@ NEW ATTRIBUTE OPTIONS
This naming scheme, in which the trigger is always private, is the same
as the builder naming scheme (just with a different prefix).
- builder => sub { ... }
- Passing a coderef to builder will cause that coderef to be installed in
- the class this attribute is associated with the name you'd expect, and
- "builder => 1" to be set.
+ handles => { foo => sub { ... }, ... }
+
+ Creating a delegation with a coderef will now create a new, "custom
+ accessor" for the attribute. These coderefs will be installed and
+ called as methods on the associated class (just as readers, writers,
+ and other accessors are), and will have the attribute metaclass
+ available in $_. Anything the accessor is called with it will have
+ access to in @_, just as you'd expect of a method.
+
+ e.g., the following example creates an attribute named 'bar' with a
+ standard reader accessor named 'bar' and two custom accessors named
+ 'foo' and 'foo_too'.
+
+ has bar => (
+
+ is => 'ro',
+ isa => 'Int',
+ handles => {
+
+ foo => sub {
+ my $self = shift @_;
+
+ return $_->get_value($self) + 1;
+ },
+
+ foo_too => sub {
+ my $self = shift @_;
+
+ return $self->bar + 1;
+ },
+ },
+ );
- e.g., in your class,
+ ...and later,
- has foo => (is => 'ro', builder => sub { 'bar!' });
+ Note that in this example both foo() and foo_too() do effectively the
+ same thing: return the attribute's current value plus 1. However, foo()
+ accesses the attribute value directly through the metaclass, the pros
+ and cons of which this author leaves as an exercise for the reader to
+ determine.
- ...is effectively the same as...
+ You may choose to use the installed accessors to get at the attribute's
+ value, or use the direct metaclass access, your choice.
- has foo => (is => 'ro', builder => '_build_foo');
- sub _build_foo { 'bar!' }
+ANONYMOUS SUBTYPING AND COERCION
+
+ "Abusus non tollit usum."
+
+ Note that we create new, anonymous subtypes whenever the constraint or
+ coercion options are specified in such a way that the Shortcuts trait
+ (this one) is invoked. It's fully supported to use both constraint and
+ coerce options at the same time.
+
+ This facility is intended to assist with the creation of one-off type
+ constraints and coercions. It is not possible to deliberately reuse the
+ subtypes we create, and if you find yourself using a particular isa /
+ constraint / coerce option triplet in more than one place you should
+ really think about creating a type that you can reuse. MooseX::Types
+ provides the facilities to easily do this, or even a simple constant
+ definition at the package level with an anonymous type stashed away for
+ local use.
+
+ isa => sub { ... }
+
+ has foo => (
+ is => 'rw',
+ # $_ == $_[0] == the value to be validated
+ isa => sub { die unless $_[0] == 1 },
+ );
+
+ # passes constraint
+ $thing->foo(1);
+
+ # fails constraint
+ $thing->foo(5);
+
+ Given a coderef, create a type constraint for the attribute. This
+ constraint will fail if the coderef dies, and pass otherwise.
+
+ Astute users will note that this is the same way Moo constraints work;
+ we use MooseX::Meta::TypeConstraint::Mooish to implement the
+ constraint.
+
+ isa_instance_of => ...
+
+ Given a package name, this option will create an isa type constraint
+ that requires the value of the attribute be an instance of the class
+ (or a descendant class) given. That is,
+
+ has foo => (is => 'ro', isa_instance_of => 'SomeThing');
+
+ ...is effectively the same as:
+
+ use Moose::TypeConstraints 'class_type';
+ has foo => (
+ is => 'ro',
+ isa => class_type('SomeThing'),
+ );
+
+ ...but a touch less awkward.
+
+ isa => ..., constraint => sub { ... }
- constraint => sub { ... }
- Specifying the constraint option with a coderef will cause a new type
- constraint to be created, with the parent type being the type specified
- in the "isa" option and the constraint being the coderef supplied here.
+ Specifying the constraint option with a coderef will cause a new
+ subtype constraint to be created, with the parent type being the type
+ specified in the isa option and the constraint being the coderef
+ supplied here.
- Example:
+ For example, only integers greater than 10 will pass this attribute's
+ type constraint:
# value must be an integer greater than 10 to pass the constraint
has thinger => (
@@ -196,14 +319,61 @@ NEW ATTRIBUTE OPTIONS
# ...
);
- Note that if you supply a constraint, you must also provide an "isa".
+ Note that if you supply a constraint, you must also provide an isa.
+
+ isa => ..., constraint => sub { ... }, coerce => 1
+
+ Supplying a constraint and asking for coercion will "Just Work", that
+ is, any coercions that the isa type has will still work.
+
+ For example, let's say that you're using the File type constraint from
+ MooseX::Types::Path::Class, and you want an additional constraint that
+ the file must exist:
+
+ has thinger => (
+ is => 'ro',
+ isa => File,
+ constraint => sub { !! $_->stat },
+ coerce => 1,
+ );
+
+ thinger will correctly coerce the string "/etc/passwd" to a
+ Path::Class:File, and will only accept the coerced result as a value if
+ the file exists.
+
+ coerce => [ Type => sub { ...coerce... }, ... ]
+
+ Specifying the coerce option with a hashref will cause a new subtype to
+ be created and used (just as with the constraint option, above), with
+ the specified coercions added to the list. In the passed hashref, the
+ keys are Moose types (well, strings resolvable to Moose types), and the
+ values are coderefs that will coerce a given type to our type.
+
+ has bar => (
+ is => 'ro',
+ isa => 'Str',
+ coerce => [
+ Int => sub { "$_" },
+ Object => sub { 'An instance of ' . ref $_ },
+ ],
+ );
+
+SEE ALSO
+
+ Please see those modules/websites for more information related to this
+ module.
+
+ * MooseX::Types
SOURCE
+
The development version is on github at
- <http://github.com/RsrchBoy/moosex-attributeshortcuts> and may be cloned
- from <git://github.com/RsrchBoy/moosex-attributeshortcuts.git>
+ http://https://github.com/RsrchBoy/moosex-attributeshortcuts and may be
+ cloned from
+ git://https://github.com/RsrchBoy/moosex-attributeshortcuts.git
BUGS
+
Please report any bugs or feature requests on the bugtracker website
https://github.com/RsrchBoy/moosex-attributeshortcuts/issues
@@ -211,9 +381,29 @@ BUGS
to an existing test-file that illustrates the bug or desired feature.
AUTHOR
+
Chris Weyl <cweyl@alumni.drew.edu>
+ I'm a material boy in a material world
+
+ Please note I do not expect to be gittip'ed or flattr'ed for this work,
+ rather it is simply a very pleasant surprise. I largely create and
+ release works like this because I need them or I find it enjoyable;
+ however, don't let that stop you if you feel like it ;)
+
+ Flattr this
+ <https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Fmoosex-attributeshortcuts&title=RsrchBoy's%20CPAN%20MooseX-AttributeShortcuts&tags=%22RsrchBoy's%20MooseX-AttributeShortcuts%20in%20the%20CPAN%22>,
+ gittip me <https://www.gittip.com/RsrchBoy/>, or indulge my Amazon
+ Wishlist <http://bit.ly/rsrchboys-wishlist>... If you so desire.
+
+CONTRIBUTORS
+
+ * David Steinbrunner <dsteinbrunner@pobox.com>
+
+ * Graham Knop <haarg@haarg.org>
+
COPYRIGHT AND LICENSE
+
This software is Copyright (c) 2011 by Chris Weyl.
This is free software, licensed under:
@@ -1,5 +1,5 @@
This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.68.
+signed via the Module::Signature module, version 0.75.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
@@ -14,18 +14,20 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 27707c7d1544a5a3cbca43bf443f39e2bb154cf5 Changes
-SHA1 0b16c282a427d2bf87e66bc839170a89d1f2f99f INSTALL
-SHA1 514760f01d379ad532c49a196f1c6f7912b65556 LICENSE
-SHA1 9944816edd6c0fd7fcd278bbeba15c4c7cb7bc14 MANIFEST
-SHA1 ad33268042d92c4c6e7539ff6d4a6f934e865831 META.json
-SHA1 9c88e60e0b7552c561fb87768b6eef39bb6994ee META.yml
-SHA1 1cec4bf30e32924dd19f502664b25f386a70c888 Makefile.PL
-SHA1 e0c405d042b5c758544b421e2f53dc7213a413ae README
-SHA1 8a912f6044f65135fee0bf30346887f5b81deae5 dist.ini
-SHA1 6aa4fded8f6dc033b20b785ab8a6fc0219ee1109 lib/MooseX/AttributeShortcuts.pm
-SHA1 ad5c40aecbdd618e03450b94dd5685a030036c0d t/00-compile.t
-SHA1 10adce6ca9e0c6692003e60696984e341b1426f9 t/000-report-versions-tiny.t
+SHA1 55ac697642a18dd7d974736a3d06fd531aa82382 .travis.yml
+SHA1 6a2df887608ff6cd1ae11db2bbd7e2604b318bab Changes
+SHA1 62c6886b1f14e9e9a39f6bf00f5490057d3c2885 LICENSE
+SHA1 7c1852f0ceaef5560285664440a473798b49b7bf MANIFEST
+SHA1 72a40b1dfb133b42fe3f53654a7ebfa3560a2b36 META.json
+SHA1 86456471e7e76410579a35bcaa6a258789a383e6 META.yml
+SHA1 ab9f277c87f924683af7add61f42ace320c47a31 Makefile.PL
+SHA1 d43fb50509b7713ce5a36540129bc07fcc3e3528 README
+SHA1 b4570359a04fc7426d8c2fa689566c45c1b4213c cpanfile
+SHA1 5dafee4fc2c3642d0de8db57ec01d89d67fa5979 dist.ini
+SHA1 b4ee08f25d8bf8fdf924c36b3d65fe58cdeadc0e lib/MooseX/AttributeShortcuts.pm
+SHA1 c522c3928158e64bd97d34d20cbfe0b5305a7eb2 t/00-check-deps.t
+SHA1 761bc6c1796b43db176c6ed2efedfa2a9be74ed2 t/00-compile.t
+SHA1 4c280df2e0a943f1a075f4ab6df64fdb6015f80f t/000-report-versions-tiny.t
SHA1 b201b29194c8e2d174032993fbf9b989d204943c t/01-basic.t
SHA1 feb9ac405e94777b2eccb564c75e81b303877592 t/02-parameterized.t
SHA1 8b3de3014b22392c176c297ec6169376b4c7d080 t/03-lazy.t
@@ -34,26 +36,41 @@ SHA1 dcdac8f250e53b097c3727c6d4e5ccf2d7512277 t/05-extend.t
SHA1 aeead510300b711df372bf0c026a60099d330927 t/06-role.t
SHA1 141674978f422f7ae85a333e45b6984fdad9a1e8 t/07-trigger.t
SHA1 2983277e0687e4cf8119b46779afb8b11b3d6329 t/anon-builder.t
+SHA1 cdb770dcc3e7834ebfef966b99b65696b4bebfe9 t/constraint.t
+SHA1 dca1fccb7685c417014a64adf9cf7dd3bac46051 t/deprecated/inline_typing.t
SHA1 0693757ec019aebd05fc427a757294136889cf74 t/funcs.pm
+SHA1 6704194966b41752902fe8fc984cd7f5c4fe3153 t/handles-coderef.t
SHA1 2a3a2473622b9bd48532a52cfb1aafe72a0d34af t/handles-metaclass.t
-SHA1 74940219af9b6d674b7fbe3189b8172a57e6d5a9 t/inline_subtyping.t
-SHA1 1f404d2af0d38f521691a6154e35de264d9ab3a0 t/inline_typing.t
-SHA1 9c3627ff37f4fd5bddc34bf46cf3359eaf76a060 t/release-consistent-version.t
-SHA1 a032c41ef6887fab1b900669c2d304fab46680e2 t/release-eol.t
-SHA1 0c566db92a9f12450c1e962d885634aa2cf1e8ca t/release-has-version.t
-SHA1 4953bba5de90d892df5886383ac42c42c167d9d9 t/release-no-smart-comments.t
-SHA1 455d1dd1867212a665ad5ea4126b572411de300c t/release-no-tabs.t
-SHA1 e9e8e7e3e707ce9bd2046a7dd3817cd5555e8874 t/release-pod-coverage.t
-SHA1 7ff128eaa77cb3639c774c44cf3e0128d691d480 t/release-pod-syntax.t
-SHA1 64fc59ae48fee3f56172b7104cb123b2e5964ba3 t/release-portability.t
+SHA1 e47d5df31a76798e7db5a7d776330cf8ca4e43f9 t/inline_coercion-back-compat.t
+SHA1 78aee97e4cb5687712f41fae37fd800cd1fe3ac7 t/inline_coercion.t
+SHA1 efa514912dc489236506a5a9aca8414a6b661e52 t/inline_subtyping.t
+SHA1 2b9133942088af2b4b6926c65d7b2da8beb1f2b6 t/inline_subtyping_with_coercion.t
+SHA1 55d5cc1a7feafab1e88a9cbeb7975f1ec0be7721 t/isa-mooish.t
+SHA1 801cfa02cf426ab31f6b1f9465cbc89d78822743 t/isa_instance_of.t
+SHA1 06ce65438552cb8bf64a1e86f5dd084aa78d1995 xt/author/eol.t
+SHA1 250f25701aa7c96afaf067b3bf1400f749327b59 xt/author/no-tabs.t
+SHA1 36733582be7dbdcfce28e2a471e6ae82f50ee837 xt/author/pod-spell.t
+SHA1 a7948d34cfaad400286ea5d5fa6206c4c7e2552c xt/release/consistent-version.t
+SHA1 cd1efd4a6edcf18422a226628e6c7a87f2ffb7df xt/release/has-version.t
+SHA1 6b9989c3e0d0e9348ab8e83a25912816be52efc0 xt/release/minimum-version.t
+SHA1 73ebc5cc0cb99fa55a82472d63cc09edbb61c96d xt/release/no-smart-comments.t
+SHA1 9ff2bd29987b01440cfe648807df8cdbeedc289c xt/release/pod-coverage.t
+SHA1 1e6adb7e320c9a83e7e5ed59fbe4080e1d029256 xt/release/pod-linkcheck.t
+SHA1 a0c20421984c072fd1701d1639592f2d7c4ff226 xt/release/pod-syntax.t
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.11 (GNU/Linux)
+Version: GnuPG v1
-iQEcBAEBAgAGBQJQjf3UAAoJEOd5N1CvIgQkz7MH/i2XMxfa9UChaOoaq/RX08Uy
-QYIUXmChTkfawQ1Lur80VSZ8au+LwT86XSREzH9icFn0UPqbK1QdfQjzIKztp6Mp
-AQoxkpNeDrsJYeI/0ThUSkcTd02o8dt/CQc4mXLg2RLnF0HlCj3SnE6rr10Ch5z+
-Snx0QUxTNxbrvxmlm/FK3Gl7LeHyz0/PiNmsS+cXHghQ25jtixOuEPQ43Q4AZM+w
-/amp05VLYUmarNW5ZMqsYL1AGek8EP4wygauPZKFKOwLEqGq+8quW9Whr2pbz+r9
-Pamqkjau5Fz8HZwW8zHXhZ0KPBScZ+bwxh/g0yrFjKVWzN8Nex0yThrhtz/PGfA=
-=WYrO
+iQIcBAEBAgAGBQJVJKRCAAoJEJ/Rlq0N/NXWkR4QAJmJoxGw594tcJKCZQwbMqYG
+LcUhbv8+x0tx/W0US9yhpLtXdZRLpK9Rb91HOm9XDrM+ApoMgfk5aBlOzkuYWAXC
+ybrLNM1QMDbZqUfstvXFmNkdaK8JalHuWrQ6NZDqi1KhzIXpej5lgXC6RGlt7nrX
+DiGwPWKP6O4wm+8nP1vwtfoCd8tBOGwWDvbbRodoM6VetSYDaSqluYIughFDibvZ
+NbXg7wwFtlwJX5WAC/2npySKndyvlS2JkU8TUyzZ5MO9ub22JuqsoHeuAgKfIGG8
+ezFS7ogiI196rGyz5pApIFRxv9Hwu5eWyySE/rkjw+Ag/TpqzoDV1tc8jry13KZe
+PlQWTH/rFtKt9mcx3B7NYu4wGrVnTMXlUaBQWdWGgB5SZyYxFo5Q446qug3cfjiD
+gHTQ1OK4Au/RdVYwV8kXgxx47SGnz56YwEcrJbRXgRa+1fcbajUh6pMbiHNzmiWL
+lnGiZjRRcK2WaNdhbV5kqawhi0lYP1NFRbgjelirSmtUa40Y4EAMTYsxKS9/d96g
+eGnOtsGPQGNuF6Lcae1dLeawlq9TkHGSco61pNA08ahVN6Y7mCX2G9FfkyI7Yrjl
+AGcv5YLI5OypZd4RHqEv0xXSkl/p3HnrFdQvZ2EbKfmAqO0y5AM/h4ialGXhS/Sr
+mq7WzzbxXZLR8GE/XkPa
+=uFNh
-----END PGP SIGNATURE-----
@@ -0,0 +1,50 @@
+requires "List::AllUtils" => "0";
+requires "Moose" => "1.14";
+requires "Moose::Exporter" => "0";
+requires "Moose::Meta::TypeConstraint" => "0";
+requires "Moose::Util::MetaRole" => "0";
+requires "Moose::Util::TypeConstraints" => "0";
+requires "MooseX::Meta::TypeConstraint::Mooish" => "0";
+requires "MooseX::Role::Parameterized" => "0";
+requires "MooseX::Types::Common::String" => "0";
+requires "MooseX::Types::Moose" => "0";
+requires "Package::DeprecationManager" => "0";
+requires "aliased" => "0";
+requires "namespace::autoclean" => "0";
+requires "perl" => "5.006";
+requires "strict" => "0";
+requires "warnings" => "0";
+
+on 'test' => sub {
+ requires "File::Spec" => "0";
+ requires "IO::Handle" => "0";
+ requires "IPC::Open3" => "0";
+ requires "Moose::Role" => "0";
+ requires "Moose::Util" => "0";
+ requires "MooseX::Types::Path::Class" => "0";
+ requires "Path::Class" => "0";
+ requires "Test::CheckDeps" => "0.010";
+ requires "Test::Fatal" => "0";
+ requires "Test::Moose" => "0";
+ requires "Test::Moose::More" => "0.018";
+ requires "Test::More" => "0.94";
+ requires "Test::Warn" => "0";
+ requires "constant" => "0";
+ requires "perl" => "5.006";
+};
+
+on 'configure' => sub {
+ requires "ExtUtils::MakeMaker" => "0";
+ requires "perl" => "5.006";
+};
+
+on 'develop' => sub {
+ requires "Pod::Coverage::TrustPod" => "0";
+ requires "Test::EOL" => "0";
+ requires "Test::More" => "0.88";
+ requires "Test::NoTabs" => "0";
+ requires "Test::Pod" => "1.41";
+ requires "Test::Pod::Coverage" => "1.08";
+ requires "Test::Spelling" => "0.12";
+ requires "version" => "0.9901";
+};
@@ -4,8 +4,6 @@ license = LGPL_2_1
copyright_holder = Chris Weyl
copyright_year = 2011
-[@Filter]
--bundle = @RSRCHBOY
--remove = Test::PodSpelling
+[@RSRCHBOY]
autoprereqs_skip = ^(funcs|TestClass.*|TestRole.*)$
tweet = 1
@@ -8,9 +8,9 @@
# The GNU Lesser General Public License, Version 2.1, February 1999
#
package MooseX::AttributeShortcuts;
-{
- $MooseX::AttributeShortcuts::VERSION = '0.017';
-}
+our $AUTHORITY = 'cpan:RSRCHBOY';
+# git description: 0.027_02-0-g8e66785
+$MooseX::AttributeShortcuts::VERSION = '0.028';
# ABSTRACT: Shorthand for common attribute options
@@ -19,26 +19,33 @@ use warnings;
use namespace::autoclean;
-use Moose ();
+use Moose 1.14 ();
use Moose::Exporter;
+use Moose::Meta::TypeConstraint;
use Moose::Util::MetaRole;
use Moose::Util::TypeConstraints;
-# debug...
-#use Smart::Comments;
-
{
package MooseX::AttributeShortcuts::Trait::Attribute;
-{
- $MooseX::AttributeShortcuts::Trait::Attribute::VERSION = '0.017';
-}
+our $AUTHORITY = 'cpan:RSRCHBOY';
+# git description: 0.027_02-0-g8e66785
+$MooseX::AttributeShortcuts::Trait::Attribute::VERSION = '0.028';
use namespace::autoclean;
use MooseX::Role::Parameterized;
- use Moose::Util::TypeConstraints qw{ class_type role_type enum };
+ use Moose::Util::TypeConstraints ':all';
use MooseX::Types::Moose ':all';
use MooseX::Types::Common::String ':all';
- sub _find_or_create_isa_type_constraint { goto \&Moose::Util::TypeConstraints::find_or_create_isa_type_constraint }
+ use aliased 'MooseX::Meta::TypeConstraint::Mooish' => 'MooishTC';
+
+ use List::AllUtils 'any';
+
+ use Package::DeprecationManager -deprecations => {
+ 'undocumented-isa-constraints' => '0.23',
+ 'hashref-given-to-coerce' => '0.24',
+ };
+
+ sub _acquire_isa_tc { goto \&Moose::Util::TypeConstraints::find_or_create_isa_type_constraint }
parameter writer_prefix => (isa => NonEmptySimpleStr, default => '_set_');
parameter builder_prefix => (isa => NonEmptySimpleStr, default => '_build_');
@@ -92,68 +99,25 @@ use Moose::Util::TypeConstraints;
my $_opt = sub { $_has->(@_) ? $options->{$_[0]} : q{} };
my $_ref = sub { ref $_opt->(@_) || q{} };
- if ($options->{is}) {
-
- if ($options->{is} eq 'rwp') {
-
- $options->{is} = 'ro';
- $options->{writer} = "$wprefix$name";
- }
-
- if ($options->{is} eq 'lazy') {
-
- $options->{is} = 'ro';
- $options->{lazy} = 1;
- $options->{builder} = 1
- unless $_has->('builder') || $_has->('default');
- }
- }
-
- # TODO isa_class - anon class_type generation
- # TODO isa_role - anon role_type generation
- # TODO isa_enum - anon enum generation
- # TODO coerce_via - anon coercion (type -> anon subtype+coercion
-
- # XXX we also ignore conflicts here -- last in wins
- #confess q{conflict 'isa' and 'isa_class' or 'isa_role'}
- #if $_has->('isa')
-
- # XXX undocumented -- not sure this is a great idea
- $options->{isa} = class_type(delete $options->{isa_class})
- if $_has->('isa_class');
- $options->{isa} = role_type(delete $options->{isa_role})
- if $_has->('isa_role');
- $options->{isa} = enum(delete $options->{isa_enum})
- if $_has->('isa_enum');
-
- $class->throw_error('You must specify an isa when declaring a constraint')
- if $_has->('constraint') && !$_has->('isa');
+ # handle: is => ...
+ $class->_mxas_is_rwp($name, $options, $_has, $_opt, $_ref);
+ $class->_mxas_is_lazy($name, $options, $_has, $_opt, $_ref);
- if (my $isa = $_opt->('isa')) {
+ # handle: builder => 1, builder => sub { ... }
+ $class->_mxas_builder($name, $options, $_has, $_opt, $_ref);
- my @opts;
+ # handle: isa_class, isa_role, isa_enum
+ $class->_mxas_isa_naughty($name, $options, $_has, $_opt, $_ref);
- # constraint checking! XXX message, etc?
- push @opts, constraint => $_opt->('constraint')
- if $_ref->('constraint') eq 'CODE';
+ # handle: isa_instance_of => ...
+ $class->_mxas_isa_instance_of($name, $options, $_has, $_opt, $_ref);
+ # handle: isa => sub { ... }
+ $class->_mxas_isa_mooish($name, $options, $_has, $_opt, $_ref);
- if (@opts) {
+ # handle: constraint => ...
+ $class->_mxas_constraint($name, $options, $_has, $_opt, $_ref);
+ $class->_mxas_coerce($name, $options, $_has, $_opt, $_ref);
- # stash our original option away and construct our new one
- $options->{original_isa} = $isa;
- $options->{isa}
- = _find_or_create_isa_type_constraint($isa)
- ->create_child_type(@opts)
- ;
- }
- }
-
- if ($options->{lazy_build} && $options->{lazy_build} eq 'private') {
-
- $options->{lazy_build} = 1;
- $options->{clearer} = "_clear_$name";
- $options->{predicate} = "_has_$name";
- }
my $is_private = sub { $name =~ /^_/ ? $_[0] : $_[1] };
my $default_for = sub {
@@ -171,19 +135,6 @@ use Moose::Util::TypeConstraints;
return;
};
- # XXX install builder here if a coderef
- if (defined $options->{builder}) {
-
- #if (ref $_opt->('builder') eq 'CODE') {
- if ((ref $options->{builder} || q{}) eq 'CODE') {
-
- $options->{_anon_builder} = $options->{builder};
- $options->{builder} = 1;
- }
-
- $options->{builder} = "$bprefix$name"
- if $options->{builder} eq '1';
- }
### set our other defaults, if requested...
$default_for->($_) for qw{ predicate clearer };
my $trigger = "$prefix{trigger}$name";
@@ -213,6 +164,203 @@ use Moose::Util::TypeConstraints;
return $self->$orig($name, %options);
};
+ # handle: is => 'rwp'
+ method _mxas_is_rwp => sub {
+ my ($class, $name, $options, $_has, $_opt, $_ref) = @_;
+
+ return unless $_opt->('is') eq 'rwp';
+
+ $options->{is} = 'ro';
+ $options->{writer} = "$wprefix$name";
+
+ return;
+ };
+
+ # handle: is => 'lazy'
+ method _mxas_is_lazy => sub {
+ my ($class, $name, $options, $_has, $_opt, $_ref) = @_;
+
+ return unless $_opt->('is') eq 'lazy';
+
+ $options->{is} = 'ro';
+ $options->{lazy} = 1;
+ $options->{builder} = 1
+ unless $_has->('builder') || $_has->('default');
+
+ return;
+ };
+
+ # handle: lazy_build => 'private'
+ method _mxas_lazy_build_private => sub {
+ my ($class, $name, $options, $_has, $_opt, $_ref) = @_;
+
+ return unless $_opt->('lazy_build') eq 'private';
+
+ $options->{lazy_build} = 1;
+ $options->{clearer} = "_clear_$name";
+ $options->{predicate} = "_has_$name";
+
+ return;
+ };
+
+ # handle: isa_class, isa_role, isa_enum
+ method _mxas_isa_naughty => sub {
+ my ($class, $name, $options, $_has, $_opt, $_ref) = @_;
+
+ return unless
+ any { exists $options->{$_} } qw{ isa_class isa_role isa_enum };
+
+ # (more than) fair warning...
+ deprecated(
+ feature => 'undocumented-isa-constraints',
+ message => 'Naughty! isa_class, isa_role, and isa_enum will be removed on or after 01 July 2015!',
+ );
+
+ # XXX undocumented -- not sure this is a great idea
+ $options->{isa} = class_type(delete $options->{isa_class})
+ if $_has->('isa_class');
+ $options->{isa} = role_type(delete $options->{isa_role})
+ if $_has->('isa_role');
+ $options->{isa} = enum(delete $options->{isa_enum})
+ if $_has->('isa_enum');
+
+ return;
+ };
+
+ # handle: builder => 1, builder => sub { ... }
+ method _mxas_builder => sub {
+ my ($class, $name, $options, $_has, $_opt, $_ref) = @_;
+
+ return unless $_has->('builder');
+
+ if ($_ref->('builder') eq 'CODE') {
+
+ $options->{_anon_builder} = $options->{builder};
+ $options->{builder} = 1;
+ }
+
+ $options->{builder} = "$bprefix$name"
+ if $options->{builder} eq '1';
+
+ return;
+ };
+
+ method _mxas_isa_mooish => sub {
+ my ($class, $name, $options, $_has, $_opt, $_ref) = @_;
+
+ return unless $_ref->('isa') eq 'CODE';
+
+ ### build a mooish type constraint...
+ $options->{original_isa} = $options->{isa};
+ $options->{isa} = MooishTC->new(constraint => $options->{isa});
+
+ return;
+ };
+
+ # handle: isa_instance_of => ...
+ method _mxas_isa_instance_of => sub {
+ my ($class, $name, $options, $_has, $_opt, $_ref) = @_;
+
+ return unless $_has->('isa_instance_of');
+
+ if ($_has->('isa')) {
+
+ $class->throw_error(
+ q{Cannot use 'isa_instance_of' and 'isa' together for attribute }
+ . $_opt->('definition_context')->{package} . '::' . $name
+ );
+ }
+
+ $options->{isa} = class_type(delete $options->{isa_instance_of});
+
+ return;
+ };
+
+ method _mxas_constraint => sub {
+ my ($class, $name, $options, $_has, $_opt, $_ref) = @_;
+
+ return unless $_has->('constraint');
+
+ # check for errors...
+ $class->throw_error('You must specify an "isa" when declaring a "constraint"')
+ if !$_has->('isa');
+ $class->throw_error('"constraint" must be a CODE reference')
+ if $_ref->('constraint') ne 'CODE';
+
+ # constraint checking! XXX message, etc?
+ push my @opts, constraint => $_opt->('constraint')
+ if $_ref->('constraint') eq 'CODE';
+
+ # stash our original option away and construct our new one
+ my $isa = $options->{original_isa} = $_opt->('isa');
+ $options->{isa} = _acquire_isa_tc($isa)->create_child_type(@opts);
+
+ return;
+ };
+
+ method _mxas_coerce => sub {
+ my ($class, $name, $options, $_has, $_opt, $_ref) = @_;
+
+ # "fix" the case of the hashref.... *sigh*
+ if ($_ref->('coerce') eq 'HASH') {
+
+ deprecated(
+ feature => 'hashref-given-to-coerce',
+ message => 'Passing a hashref to coerce is unsafe, and will be removed on or after 01 Jan 2015',
+ );
+
+ $options->{coerce} = [ %{ $options->{coerce} } ];
+ }
+
+ if ($_ref->('coerce') eq 'ARRAY') {
+
+ ### must be type => sub { ... } pairs...
+ my @coercions = @{ $_opt->('coerce') };
+ confess 'You must specify an "isa" when declaring "coercion"'
+ unless $_has->('isa');
+ confess 'coercion array must be in pairs!'
+ if @coercions % 2;
+ confess 'must define at least one coercion pair!'
+ unless @coercions > 0;
+
+ my $our_coercion = Moose::Meta::TypeCoercion->new;
+ my $our_type
+ = $options->{original_isa}
+ ? $options->{isa}
+ : _acquire_isa_tc($_opt->('isa'))->create_child_type
+ ;
+
+ $our_coercion->add_type_coercions(@coercions);
+ $our_type->coercion($our_coercion);
+
+ $options->{original_isa} ||= $options->{isa};
+ $options->{isa} = $our_type;
+ $options->{coerce} = 1;
+
+ return;
+ }
+
+ # If our original constraint has coercions and our created subtype
+ # did not have any (as specified in the 'coerce' option), then
+ # copy the parent's coercions over.
+
+ if ($_has->('original_isa') && $_opt->('coerce') eq '1') {
+
+ my $isa_type = _acquire_isa_tc($_opt->('original_isa'));
+
+ if ($isa_type->has_coercion) {
+
+ # create our coercion as a copy of the parent
+ $_opt->('isa')->coercion(Moose::Meta::TypeCoercion->new(
+ type_constraint => $_opt->('isa'),
+ type_coercion_map => [ @{ $isa_type->coercion->type_coercion_map } ],
+ ));
+ }
+
+ }
+
+ return;
+ };
# we hijack attach_to_class in order to install our anon_builder, if
# we have one. Note that we don't go the normal
@@ -227,6 +375,36 @@ use Moose::Util::TypeConstraints;
$class->add_method($self->builder => $self->anon_builder);
return;
};
+
+ method mi => sub { shift->associated_class->get_meta_instance };
+ method weaken_value => sub { $_[0]->mi->weaken_slot_value($_[1] => $_) for $_[0]->slots };
+ method strengthen_value => sub { $_[0]->mi->strengthen_slot_value($_[1] => $_) for $_[0]->slots };
+
+ # NOTE: remove_delegation() will also automagically remove any custom
+ # accessors we create here
+
+ around _make_delegation_method => sub {
+ my ($orig, $self) = (shift, shift);
+ my ($name, $coderef) = @_;
+
+ ### _make_delegation_method() called with a: ref $coderef
+ return $self->$orig(@_)
+ unless 'CODE' eq ref $coderef;
+
+ # this coderef will be installed as a method on the associated class itself.
+ my $custom_coderef = sub {
+ # aka $self from the class instance's perspective
+ my $associated_class_instance = shift @_;
+
+ # in $coderef, $_ will be the attribute metaclass
+ local $_ = $self;
+ return $associated_class_instance->$coderef(@_);
+ };
+
+ return $self->_process_accessors(custom => { $name => $custom_coderef });
+ };
+
+ return;
};
}
@@ -264,10 +442,10 @@ sub init_meta {
die "Class $for_class has no metaclass!"
unless Class::MOP::class_of($for_class);
- # If we're given paramaters to pass on to construct a role with, we build
+ # If we're given parameters to pass on to construct a role with, we build
# it out here rather than pass them on and allowing apply_metaroles() to
- # handle it, as there are Very Loud Warnings about how paramatized roles
- # are non-cachable when generated on the fly.
+ # handle it, as there are Very Loud Warnings about how parameterized roles
+ # are non-cacheable when generated on the fly.
### $params
my $role
@@ -279,10 +457,12 @@ sub init_meta {
;
Moose::Util::MetaRole::apply_metaroles(
- for => $for_class,
- class_metaroles => { attribute => [ $role ] },
# TODO add attribute trait here to create builder method if found
- role_metaroles => { applied_attribute => [ $role ] },
+ for => $for_class,
+ class_metaroles => { attribute => [ $role ] },
+ role_metaroles => { applied_attribute => [ $role ] },
+ parameter_metaroles => { applied_attribute => [ $role ] },
+ parameterized_role_metaroles => { applied_attribute => [ $role ] },
);
return Class::MOP::class_of($for_class);
@@ -294,9 +474,12 @@ __END__
=pod
-=encoding utf-8
+=encoding UTF-8
-=for :stopwords Chris Weyl
+=for :stopwords Chris Weyl David Graham Knop Steinbrunner GitHub attribute's isa one's rwp
+SUBTYPING foo
+
+=for :stopwords Wishlist flattr flattr'ed gittip gittip'ed
=head1 NAME
@@ -304,7 +487,7 @@ MooseX::AttributeShortcuts - Shorthand for common attribute options
=head1 VERSION
-This document describes version 0.017 of MooseX::AttributeShortcuts - released October 28, 2012 as part of MooseX-AttributeShortcuts.
+This document describes version 0.028 of MooseX::AttributeShortcuts - released April 07, 2015 as part of MooseX-AttributeShortcuts.
=head1 SYNOPSIS
@@ -357,6 +540,8 @@ This package causes an attribute trait to be applied to all attributes defined
to the using class. This trait extends the attribute option processing to
handle the above variations.
+=for Pod::Coverage init_meta
+
=head1 USAGE
This package automatically applies an attribute metaclass trait. Unless you
@@ -440,6 +625,21 @@ Specifying C<builder =E<gt> 1> will cause the following options to be set:
builder => "_build_$name"
+=head2 builder => sub { ... }
+
+Passing a coderef to builder will cause that coderef to be installed in the
+class this attribute is associated with the name you'd expect, and
+C<builder =E<gt> 1> to be set.
+
+e.g., in your class,
+
+ has foo => (is => 'ro', builder => sub { 'bar!' });
+
+...is effectively the same as...
+
+ has foo => (is => 'ro', builder => '_build_foo');
+ sub _build_foo { 'bar!' }
+
=head2 clearer => 1
Specifying C<clearer =E<gt> 1> will cause the following options to be set:
@@ -482,28 +682,111 @@ For an attribute named "_foo":
This naming scheme, in which the trigger is always private, is the same as the
builder naming scheme (just with a different prefix).
-=head2 builder => sub { ... }
+=head2 handles => { foo => sub { ... }, ... }
-Passing a coderef to builder will cause that coderef to be installed in the
-class this attribute is associated with the name you'd expect, and
-C<builder =E<gt> 1> to be set.
+Creating a delegation with a coderef will now create a new, "custom accessor"
+for the attribute. These coderefs will be installed and called as methods on
+the associated class (just as readers, writers, and other accessors are), and
+will have the attribute metaclass available in $_. Anything the accessor
+is called with it will have access to in @_, just as you'd expect of a method.
-e.g., in your class,
+e.g., the following example creates an attribute named 'bar' with a standard
+reader accessor named 'bar' and two custom accessors named 'foo' and
+'foo_too'.
- has foo => (is => 'ro', builder => sub { 'bar!' });
+ has bar => (
-...is effectively the same as...
+ is => 'ro',
+ isa => 'Int',
+ handles => {
- has foo => (is => 'ro', builder => '_build_foo');
- sub _build_foo { 'bar!' }
+ foo => sub {
+ my $self = shift @_;
-=head2 constraint => sub { ... }
+ return $_->get_value($self) + 1;
+ },
-Specifying the constraint option with a coderef will cause a new type
+ foo_too => sub {
+ my $self = shift @_;
+
+ return $self->bar + 1;
+ },
+ },
+ );
+
+...and later,
+
+Note that in this example both foo() and foo_too() do effectively the same
+thing: return the attribute's current value plus 1. However, foo() accesses
+the attribute value directly through the metaclass, the pros and cons of
+which this author leaves as an exercise for the reader to determine.
+
+You may choose to use the installed accessors to get at the attribute's value,
+or use the direct metaclass access, your choice.
+
+=head1 ANONYMOUS SUBTYPING AND COERCION
+
+ "Abusus non tollit usum."
+
+Note that we create new, anonymous subtypes whenever the constraint or
+coercion options are specified in such a way that the Shortcuts trait (this
+one) is invoked. It's fully supported to use both constraint and coerce
+options at the same time.
+
+This facility is intended to assist with the creation of one-off type
+constraints and coercions. It is not possible to deliberately reuse the
+subtypes we create, and if you find yourself using a particular isa /
+constraint / coerce option triplet in more than one place you should really
+think about creating a type that you can reuse. L<MooseX::Types> provides
+the facilities to easily do this, or even a simple L<constant> definition at
+the package level with an anonymous type stashed away for local use.
+
+=head2 isa => sub { ... }
+
+ has foo => (
+ is => 'rw',
+ # $_ == $_[0] == the value to be validated
+ isa => sub { die unless $_[0] == 1 },
+ );
+
+ # passes constraint
+ $thing->foo(1);
+
+ # fails constraint
+ $thing->foo(5);
+
+Given a coderef, create a type constraint for the attribute. This constraint
+will fail if the coderef dies, and pass otherwise.
+
+Astute users will note that this is the same way L<Moo> constraints work; we
+use L<MooseX::Meta::TypeConstraint::Mooish> to implement the constraint.
+
+=head2 isa_instance_of => ...
+
+Given a package name, this option will create an C<isa> type constraint that
+requires the value of the attribute be an instance of the class (or a
+descendant class) given. That is,
+
+ has foo => (is => 'ro', isa_instance_of => 'SomeThing');
+
+...is effectively the same as:
+
+ use Moose::TypeConstraints 'class_type';
+ has foo => (
+ is => 'ro',
+ isa => class_type('SomeThing'),
+ );
+
+...but a touch less awkward.
+
+=head2 isa => ..., constraint => sub { ... }
+
+Specifying the constraint option with a coderef will cause a new subtype
constraint to be created, with the parent type being the type specified in the
C<isa> option and the constraint being the coderef supplied here.
-Example:
+For example, only integers greater than 10 will pass this attribute's type
+constraint:
# value must be an integer greater than 10 to pass the constraint
has thinger => (
@@ -514,12 +797,59 @@ Example:
Note that if you supply a constraint, you must also provide an C<isa>.
-=for Pod::Coverage init_meta
+=head2 isa => ..., constraint => sub { ... }, coerce => 1
+
+Supplying a constraint and asking for coercion will "Just Work", that is, any
+coercions that the C<isa> type has will still work.
+
+For example, let's say that you're using the C<File> type constraint from
+L<MooseX::Types::Path::Class>, and you want an additional constraint that the
+file must exist:
+
+ has thinger => (
+ is => 'ro',
+ isa => File,
+ constraint => sub { !! $_->stat },
+ coerce => 1,
+ );
+
+C<thinger> will correctly coerce the string "/etc/passwd" to a
+C<Path::Class:File>, and will only accept the coerced result as a value if
+the file exists.
+
+=head2 coerce => [ Type => sub { ...coerce... }, ... ]
+
+Specifying the coerce option with a hashref will cause a new subtype to be
+created and used (just as with the constraint option, above), with the
+specified coercions added to the list. In the passed hashref, the keys are
+Moose types (well, strings resolvable to Moose types), and the values are
+coderefs that will coerce a given type to our type.
+
+ has bar => (
+ is => 'ro',
+ isa => 'Str',
+ coerce => [
+ Int => sub { "$_" },
+ Object => sub { 'An instance of ' . ref $_ },
+ ],
+ );
+
+=head1 SEE ALSO
+
+Please see those modules/websites for more information related to this module.
+
+=over 4
+
+=item *
+
+L<MooseX::Types|MooseX::Types>
+
+=back
=head1 SOURCE
-The development version is on github at L<http://github.com/RsrchBoy/moosex-attributeshortcuts>
-and may be cloned from L<git://github.com/RsrchBoy/moosex-attributeshortcuts.git>
+The development version is on github at L<http://https://github.com/RsrchBoy/moosex-attributeshortcuts>
+and may be cloned from L<git://https://github.com/RsrchBoy/moosex-attributeshortcuts.git>
=head1 BUGS
@@ -534,6 +864,41 @@ feature.
Chris Weyl <cweyl@alumni.drew.edu>
+=head2 I'm a material boy in a material world
+
+=begin html
+
+<a href="https://www.gittip.com/RsrchBoy/"><img src="https://raw.githubusercontent.com/gittip/www.gittip.com/master/www/assets/%25version/logo.png" /></a>
+<a href="http://bit.ly/rsrchboys-wishlist"><img src="http://wps.io/wp-content/uploads/2014/05/amazon_wishlist.resized.png" /></a>
+<a href="https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Fmoosex-attributeshortcuts&title=RsrchBoy's%20CPAN%20MooseX-AttributeShortcuts&tags=%22RsrchBoy's%20MooseX-AttributeShortcuts%20in%20the%20CPAN%22"><img src="http://api.flattr.com/button/flattr-badge-large.png" /></a>
+
+=end html
+
+Please note B<I do not expect to be gittip'ed or flattr'ed for this work>,
+rather B<it is simply a very pleasant surprise>. I largely create and release
+works like this because I need them or I find it enjoyable; however, don't let
+that stop you if you feel like it ;)
+
+L<Flattr this|https://flattr.com/submit/auto?user_id=RsrchBoy&url=https%3A%2F%2Fgithub.com%2FRsrchBoy%2Fmoosex-attributeshortcuts&title=RsrchBoy's%20CPAN%20MooseX-AttributeShortcuts&tags=%22RsrchBoy's%20MooseX-AttributeShortcuts%20in%20the%20CPAN%22>,
+L<gittip me|https://www.gittip.com/RsrchBoy/>, or indulge my
+L<Amazon Wishlist|http://bit.ly/rsrchboys-wishlist>... If you so desire.
+
+=head1 CONTRIBUTORS
+
+=for stopwords David Steinbrunner Graham Knop
+
+=over 4
+
+=item *
+
+David Steinbrunner <dsteinbrunner@pobox.com>
+
+=item *
+
+Graham Knop <haarg@haarg.org>
+
+=back
+
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2011 by Chris Weyl.
@@ -0,0 +1,17 @@
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::CheckDeps 0.012
+
+use Test::More 0.94;
+use Test::CheckDeps 0.010;
+
+
+check_dependencies('suggests');
+
+
+if (1) {
+ BAIL_OUT("Missing dependencies") if !Test::More->builder->is_passing;
+}
+
+done_testing;
@@ -1,82 +1,51 @@
-#!perl
-#
-# This file is part of MooseX-AttributeShortcuts
-#
-# 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 5.006;
use strict;
use warnings;
+# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.052
+
use Test::More;
+plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
+
+my @module_files = (
+ 'MooseX/AttributeShortcuts.pm'
+);
-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',
-);
+# no fake home requested
-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 $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
-my @scripts;
-do { push @scripts, _find_scripts($_) if -d $_ }
- for qw{ bin script scripts };
+use File::Spec;
+use IPC::Open3;
+use IO::Handle;
-my $plan = scalar(@modules) + scalar(@scripts);
-$plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
+open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
+my @warnings;
+for my $lib (@module_files)
{
- # 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" );
- }
+ # see L<perlfaq8/How can I capture STDERR from an external command?>
+ my $stderr = IO::Handle->new;
+
+ my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
+ binmode $stderr, ':crlf' if $^O eq 'MSWin32';
+ my @_warnings = <$stderr>;
+ waitpid($pid, 0);
+ is($?, 0, "$lib loaded ok");
+
+ if (@_warnings)
+ {
+ warn @_warnings;
+ push @warnings, @_warnings;
}
}
+
+
+
+is(scalar(@warnings), 0, 'no warnings found')
+ or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING};
+
+
@@ -9,7 +9,7 @@ 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.08\n";
+my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n";
eval { # no excuses!
# report our Perl details
@@ -48,28 +48,35 @@ sub pmver {
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','any version') };
+eval { $v .= pmver('ExtUtils::MakeMaker','any version') };
+eval { $v .= pmver('File::Spec','any version') };
+eval { $v .= pmver('IO::Handle','any version') };
+eval { $v .= pmver('IPC::Open3','any version') };
+eval { $v .= pmver('List::AllUtils','any version') };
+eval { $v .= pmver('Moose','1.14') };
eval { $v .= pmver('Moose::Exporter','any version') };
+eval { $v .= pmver('Moose::Meta::TypeConstraint','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('Moose::Util::TypeConstraints','any version') };
+eval { $v .= pmver('MooseX::Meta::TypeConstraint::Mooish','any version') };
eval { $v .= pmver('MooseX::Role::Parameterized','any version') };
eval { $v .= pmver('MooseX::Types::Common::String','any version') };
eval { $v .= pmver('MooseX::Types::Moose','any version') };
-eval { $v .= pmver('Pod::Coverage::TrustPod','any version') };
+eval { $v .= pmver('MooseX::Types::Path::Class','any version') };
+eval { $v .= pmver('Package::DeprecationManager','any version') };
+eval { $v .= pmver('Path::Class','any version') };
+eval { $v .= pmver('Test::CheckDeps','0.010') };
eval { $v .= pmver('Test::Fatal','any version') };
eval { $v .= pmver('Test::Moose','any version') };
-eval { $v .= pmver('Test::Moose::More','0.017') };
-eval { $v .= pmver('Test::More','0.88') };
-eval { $v .= pmver('Test::Pod','1.41') };
-eval { $v .= pmver('Test::Pod::Coverage','1.08') };
+eval { $v .= pmver('Test::Moose::More','0.018') };
+eval { $v .= pmver('Test::More','0.94') };
+eval { $v .= pmver('Test::Warn','any version') };
+eval { $v .= pmver('aliased','any version') };
eval { $v .= pmver('constant','any version') };
eval { $v .= pmver('namespace::autoclean','any version') };
eval { $v .= pmver('strict','any version') };
-eval { $v .= pmver('version','0.9901') };
eval { $v .= pmver('warnings','any version') };
@@ -0,0 +1,51 @@
+use strict;
+use warnings;
+
+# test our new constraint option
+#
+# this test is perhaps a bit redundnant, given t/inline_*.t, but it's kinda
+# where I'd like to see it go when Test::Moose::More is retrofitted with
+# isa/type_constraint checking support.
+
+use Test::More;
+use Test::Moose::More;
+use Moose::Util;
+use Moose::Util::TypeConstraints;
+
+my $shortcuts;
+
+{
+ package TestClass;
+
+ use Moose;
+ use namespace::autoclean;
+ use MooseX::AttributeShortcuts;
+
+ $shortcuts = Shortcuts;
+
+ has foo => (
+ is => 'rw',
+ isa => 'Str',
+ constraint => sub { /^Hi/ },
+ );
+
+}
+
+my $tc =
+ Moose::Util::TypeConstraints::find_or_create_isa_type_constraint('Str')
+ ->create_child_type(constraint => sub { /^Hi/ })
+ ;
+
+validate_class TestClass => (
+ attributes => [
+ foo => {
+ -does => [ $shortcuts ],
+ accessor => 'foo',
+ original_isa => 'Str',
+ type_constraint => $tc,
+ isa => $tc,
+ },
+ ],
+);
+
+done_testing;
@@ -0,0 +1,49 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Moose::More;
+
+{
+ package TestClass;
+
+ use Moose;
+ use namespace::autoclean;
+ use MooseX::AttributeShortcuts;
+ use Test::Warn;
+
+ warnings_exist {
+ has bar => (is => 'ro', isa_class => 'SomeClass');
+ has baz => (is => 'rwp', isa_role => 'SomeRole');
+ }
+ [ qr/Naughty! isa_class, isa_role, and isa_enum will be removed on or after 01 July 2015!/ ],
+ 'expected warnings thrown for isa_class, isa_role usage',
+ ;
+}
+
+# TODO shift the constraint checking out into TMM?
+
+validate_class TestClass => (
+ attributes => [ qw{ bar baz } ],
+);
+
+subtest 'isa_class check' => sub {
+ my $att = 'bar';
+ my $meta = TestClass->meta->get_attribute($att);
+ ok $meta->has_type_constraint, "$att has a type constraint";
+ my $tc = $meta->type_constraint;
+ isa_ok $tc, 'Moose::Meta::TypeConstraint::Class';
+ is $tc->class, 'SomeClass', 'tc looks for correct class';
+};
+
+subtest 'isa_role check' => sub {
+ my $att = 'baz';
+ my $meta = TestClass->meta->get_attribute($att);
+ ok $meta->has_type_constraint, "$att has a type constraint";
+ my $tc = $meta->type_constraint;
+ isa_ok $tc, 'Moose::Meta::TypeConstraint::Role';
+ is $tc->role, 'SomeRole', 'tc looks for correct role';
+};
+
+
+done_testing;
@@ -0,0 +1,44 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Moose::More;
+
+{
+ package TestClass;
+
+ use Moose;
+ use namespace::autoclean;
+ use MooseX::AttributeShortcuts;
+
+ has foo => (
+ is => 'ro',
+ isa => 'Int',
+
+ handles => {
+
+ our_accessor => sub {
+ my $self = shift @_;
+
+ Test::More::pass 'in our_accessor()';
+ Test::More::isa_ok $_, 'Moose::Meta::Attribute';
+ return $_->get_value($self) + 2;
+ },
+ },
+ );
+}
+
+validate_class TestClass => (
+
+ attributes => [ qw{ foo } ],
+ methods => [ qw{ foo our_accessor } ],
+);
+
+my $tc = TestClass->new(foo => 4);
+
+isa_ok($tc, 'TestClass');
+
+is $tc->foo, 4, 'foo() is 4';
+is $tc->our_accessor, 6, 'our_accessor() is 6';
+
+done_testing;
@@ -0,0 +1,99 @@
+use strict;
+use warnings;
+
+# small, minimal test to ensure our hashref-based attribute matching is still
+# working as expected
+#
+# That is to say, working unless you hit a nasty bug.
+
+use Test::More;
+use Test::Moose::More 0.018;
+use Test::Fatal;
+
+{ package TestClass::From; use Moose; }
+
+my $i = 0;
+my $sc_trait;
+
+{
+ package TestClass;
+
+ use Moose;
+ use namespace::autoclean;
+ use MooseX::AttributeShortcuts;
+ use Path::Class;
+ use MooseX::Types::Path::Class ':all';
+ use Test::Warn;
+
+ $sc_trait = Shortcuts;
+
+ warnings_exist {
+ has bar => (
+ is => 'rw',
+ isa => File,
+ coerce => {
+ 'TestClass::From' => sub { $i++; return file('foo') },
+ 'Str' => sub { $i++; file $_ },
+ },
+ )
+ }
+ [ qr/Passing a hashref to coerce is unsafe, and will be removed on or after 01 Jan 2015/ ],
+ 'expected warning thrown for coerce => {} usage',
+ ;
+}
+
+use Path::Class;
+use MooseX::Types::Path::Class ':all';
+
+# TODO shift the constraint checking out into TMM?
+
+validate_class TestClass => (
+ attributes => [
+ bar => {
+ -does => [ $sc_trait ],
+ reader => undef,
+ writer => undef,
+ accessor => 'bar',
+ isa => File,
+ original_isa => 'MooseX::Types::Path::Class::File',
+ coerce => 1,
+ required => undef,
+ },
+ ],
+);
+
+subtest 'Str coercion OK' => sub {
+
+ my $tc;
+ my $msg = exception { $tc = TestClass->new(bar => 'foo') };
+ is $msg, undef, 'does not die on construction';
+ my $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ is "$bar", 'foo', 'value is correct';
+
+ $msg = exception { $tc->bar('baz') };
+ is $msg, undef, 'does not die on setting';
+ $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ is "$bar", 'baz', 'value is correct';
+};
+
+subtest 'TestClass::From coercion OK' => sub {
+
+ my $tc;
+ my $tf = TestClass::From->new();
+ my $msg = exception { $tc = TestClass->new(bar => $tf) };
+ is $msg, undef, 'does not die on construction';
+ my $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ is "$bar", 'foo', 'value is correct';
+
+ $msg = exception { $tc->bar($tf) };
+ is $msg, undef, 'does not die on setting';
+ $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ # yeah, I know, just go with it for now
+ is "$bar", 'foo', 'value is correct';
+};
+
+done_testing;
@@ -0,0 +1,87 @@
+use strict;
+use warnings;
+
+{ package TestClass::From; use Moose; }
+
+my $i = 0;
+my $sc_trait;
+
+{
+ package TestClass;
+
+ use Moose;
+ use namespace::autoclean;
+ use MooseX::AttributeShortcuts;
+ use Path::Class;
+ use MooseX::Types::Path::Class ':all';
+
+ $sc_trait = Shortcuts;
+
+ has bar => (
+ is => 'rw',
+ isa => File,
+ coerce => [
+ 'TestClass::From' => sub { $i++; return file('foo') },
+ 'Str' => sub { $i++; file $_ },
+ ],
+ );
+}
+
+use Test::More;
+use Test::Moose::More 0.018;
+use Test::Fatal;
+use Path::Class;
+use MooseX::Types::Path::Class ':all';
+
+# TODO shift the constraint checking out into TMM?
+
+validate_class TestClass => (
+ attributes => [
+ bar => {
+ -does => [ $sc_trait ],
+ reader => undef,
+ writer => undef,
+ accessor => 'bar',
+ isa => File,
+ original_isa => 'MooseX::Types::Path::Class::File',
+ coerce => 1,
+ required => undef,
+ },
+ ],
+);
+
+subtest 'Str coercion OK' => sub {
+
+ my $tc;
+ my $msg = exception { $tc = TestClass->new(bar => 'foo') };
+ is $msg, undef, 'does not die on construction';
+ my $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ is "$bar", 'foo', 'value is correct';
+
+ $msg = exception { $tc->bar('baz') };
+ is $msg, undef, 'does not die on setting';
+ $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ is "$bar", 'baz', 'value is correct';
+};
+
+subtest 'TestClass::From coercion OK' => sub {
+
+ my $tc;
+ my $tf = TestClass::From->new();
+ my $msg = exception { $tc = TestClass->new(bar => $tf) };
+ is $msg, undef, 'does not die on construction';
+ my $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ is "$bar", 'foo', 'value is correct';
+
+ $msg = exception { $tc->bar($tf) };
+ is $msg, undef, 'does not die on setting';
+ $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ # yeah, I know, just go with it for now
+ is "$bar", 'foo', 'value is correct';
+};
+
+done_testing;
@@ -53,6 +53,7 @@ subtest 'value NOT OK' => sub {
my $tc;
my $msg = exception { $tc = TestClass->new(bar => -10) };
+ ok !!$msg, 'dies on bad value';
like $msg, $error, 'dies with expected message';
$msg = exception { $tc = TestClass->new(bar => 10) };
@@ -60,6 +61,7 @@ subtest 'value NOT OK' => sub {
is $tc->bar, 10, 'value is correct';
$msg = exception { $tc->bar(-10) };
+ ok !!$msg, 'dies on bad value';
like $msg, $error, 'dies with expected message';
};
@@ -0,0 +1,81 @@
+use strict;
+use warnings;
+
+{
+ package TestClass;
+
+ use Moose;
+ use namespace::autoclean;
+ use MooseX::AttributeShortcuts;
+
+ use MooseX::Types::Path::Class ':all';
+
+ has bar => (
+ is => 'rw',
+ isa => File,
+ coerce => 1,
+ constraint => sub { "$_" =~ /foo|baz/ },
+ );
+}
+
+use Test::More;
+use Test::Moose::More 0.018;
+use Test::Fatal;
+use Path::Class;
+use MooseX::Types::Path::Class ':all';
+
+# TODO shift the constraint checking out into TMM?
+
+validate_class TestClass => (
+ attributes => [
+ bar => {
+ reader => undef,
+ writer => undef,
+ accessor => 'bar',
+ original_isa => File,
+ coerce => 1,
+ required => undef,
+ },
+ ],
+);
+
+
+subtest 'value OK' => sub {
+
+ my $tc;
+ my $msg = exception { $tc = TestClass->new(bar => 'foo') };
+ is $msg, undef, 'does not die on construction';
+ my $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ is "$bar", 'foo', 'value is correct';
+
+ $msg = exception { $tc->bar('baz') };
+ is $msg, undef, 'does not die on setting';
+ $bar = $tc->bar;
+ isa_ok $bar, 'Path::Class::File';
+ is "$bar", 'baz', 'value is correct';
+};
+
+subtest 'value NOT OK' => sub {
+
+ my $error = qr/Attribute \(bar\) does not pass the type constraint/;
+
+ my $tc;
+ my $msg = exception { $tc = TestClass->new(bar => 'bip') };
+ ok !!$msg, 'dies on bad value';
+ like $msg, $error, 'dies with expected message';
+
+ $msg = exception { $tc = TestClass->new(bar => file('bip')) };
+ ok !!$msg, 'dies on bad value';
+ like $msg, $error, 'dies with expected message';
+
+ $tc = TestClass->new;
+ $msg = exception { $tc->bar('bip') };
+ ok !!$msg, 'dies on bad value';
+ like $msg, $error, 'dies with expected message';
+ $msg = exception { $tc->bar(file 'bip') };
+ ok !!$msg, 'dies on bad value';
+ like $msg, $error, 'dies with expected message';
+};
+
+done_testing;
@@ -1,43 +0,0 @@
-use strict;
-use warnings;
-
-{
- package TestClass;
-
- use Moose;
- use namespace::autoclean;
- use MooseX::AttributeShortcuts;
-
- has bar => (is => 'ro', isa_class => 'SomeClass');
- has baz => (is => 'rwp', isa_role => 'SomeRole');
-}
-
-use Test::More;
-use Test::Moose::More;
-
-# TODO shift the constraint checking out into TMM?
-
-validate_class TestClass => (
- attributes => [ qw{ bar baz } ],
-);
-
-subtest 'isa_class check' => sub {
- my $att = 'bar';
- my $meta = TestClass->meta->get_attribute($att);
- ok $meta->has_type_constraint, "$att has a type constraint";
- my $tc = $meta->type_constraint;
- isa_ok $tc, 'Moose::Meta::TypeConstraint::Class';
- is $tc->class, 'SomeClass', 'tc looks for correct class';
-};
-
-subtest 'isa_role check' => sub {
- my $att = 'baz';
- my $meta = TestClass->meta->get_attribute($att);
- ok $meta->has_type_constraint, "$att has a type constraint";
- my $tc = $meta->type_constraint;
- isa_ok $tc, 'Moose::Meta::TypeConstraint::Role';
- is $tc->role, 'SomeRole', 'tc looks for correct role';
-};
-
-
-done_testing;
@@ -0,0 +1,66 @@
+use strict;
+use warnings;
+
+{
+ package TestClass;
+
+ use Moose;
+ use namespace::autoclean;
+ use MooseX::AttributeShortcuts;
+
+ has bar => (
+ is => 'rw',
+ isa => sub { die unless $_[0] == 5 || $_[0] == 10 },
+ );
+}
+
+use Test::More;
+use Test::Moose::More 0.017;
+use Test::Fatal;
+
+# TODO shift the constraint checking out into TMM?
+
+validate_class TestClass => (
+ attributes => [
+ bar => {
+ reader => undef,
+ writer => undef,
+ accessor => 'bar',
+ required => undef,
+ },
+ ],
+);
+
+
+subtest 'value OK' => sub {
+
+ my $tc;
+
+ my $msg = exception { $tc = TestClass->new(bar => 5) };
+ is $msg, undef, 'does not die on construction';
+ is $tc->bar, 5, 'value is correct';
+
+ $msg = exception { $tc->bar(10) };
+ is $msg, undef, 'does not die on setting';
+ is $tc->bar, 10, 'value is correct';
+};
+
+subtest 'value NOT OK' => sub {
+
+ my $error = qr/Attribute \(bar\) does not pass the type constraint/;
+
+ my $tc;
+ my $msg = exception { $tc = TestClass->new(bar => -10) };
+ ok !!$msg, 'dies on bad value';
+ like $msg, $error, 'dies with expected message';
+
+ $msg = exception { $tc = TestClass->new(bar => 5) };
+ is $msg, undef, 'does not die on construction with OK value';
+ is $tc->bar, 5, 'value is correct';
+
+ $msg = exception { $tc->bar(-10) };
+ ok !!$msg, 'dies on bad value';
+ like $msg, $error, 'dies with expected message';
+};
+
+done_testing;
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+
+{
+ package TestClass;
+
+ use Moose;
+ use namespace::autoclean;
+ use MooseX::AttributeShortcuts;
+
+ has bar => (is => 'ro', isa_instance_of => 'SomeClass');
+}
+
+use Test::More;
+use Test::Moose::More;
+
+# TODO shift the constraint checking out into TMM?
+
+validate_class TestClass => (
+ attributes => [ qw{ bar } ],
+);
+
+subtest 'isa_instance_of check' => sub {
+ my $att = 'bar';
+ my $meta = TestClass->meta->get_attribute($att);
+ ok $meta->has_type_constraint, "$att has a type constraint";
+ my $tc = $meta->type_constraint;
+ isa_ok $tc, 'Moose::Meta::TypeConstraint::Class';
+ is $tc->class, 'SomeClass', 'tc looks for correct class';
+};
+
+done_testing;
@@ -1,18 +0,0 @@
-
-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();
@@ -1,16 +0,0 @@
-
-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 });
@@ -1,25 +0,0 @@
-#!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-AttributeShortcuts
-#
-# 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();
@@ -1,31 +0,0 @@
-#!/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-AttributeShortcuts
-#
-# 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();
@@ -1,16 +0,0 @@
-
-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();
@@ -1,30 +0,0 @@
-#!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-AttributeShortcuts
-#
-# 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' });
@@ -1,24 +0,0 @@
-#!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-AttributeShortcuts
-#
-# 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();
@@ -1,25 +0,0 @@
-#!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-AttributeShortcuts
-#
-# 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();
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::EOL 0.17
+
+use Test::More 0.88;
+use Test::EOL;
+
+my @files = (
+ 'lib/MooseX/AttributeShortcuts.pm',
+ 't/00-check-deps.t',
+ 't/00-compile.t',
+ 't/000-report-versions-tiny.t',
+ 't/01-basic.t',
+ 't/02-parameterized.t',
+ 't/03-lazy.t',
+ 't/04-clearer-and-predicate.t',
+ 't/05-extend.t',
+ 't/06-role.t',
+ 't/07-trigger.t',
+ 't/anon-builder.t',
+ 't/constraint.t',
+ 't/deprecated/inline_typing.t',
+ 't/funcs.pm',
+ 't/handles-coderef.t',
+ 't/handles-metaclass.t',
+ 't/inline_coercion-back-compat.t',
+ 't/inline_coercion.t',
+ 't/inline_subtyping.t',
+ 't/inline_subtyping_with_coercion.t',
+ 't/isa-mooish.t',
+ 't/isa_instance_of.t'
+);
+
+eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
+done_testing;
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.13
+
+use Test::More 0.88;
+use Test::NoTabs;
+
+my @files = (
+ 'lib/MooseX/AttributeShortcuts.pm',
+ 't/00-check-deps.t',
+ 't/00-compile.t',
+ 't/000-report-versions-tiny.t',
+ 't/01-basic.t',
+ 't/02-parameterized.t',
+ 't/03-lazy.t',
+ 't/04-clearer-and-predicate.t',
+ 't/05-extend.t',
+ 't/06-role.t',
+ 't/07-trigger.t',
+ 't/anon-builder.t',
+ 't/constraint.t',
+ 't/deprecated/inline_typing.t',
+ 't/funcs.pm',
+ 't/handles-coderef.t',
+ 't/handles-metaclass.t',
+ 't/inline_coercion-back-compat.t',
+ 't/inline_coercion.t',
+ 't/inline_subtyping.t',
+ 't/inline_subtyping_with_coercion.t',
+ 't/isa-mooish.t',
+ 't/isa_instance_of.t'
+);
+
+notabs_ok($_) foreach @files;
+done_testing;
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+use Test::More;
+
+# generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006008
+use Test::Spelling 0.12;
+use Pod::Wordlist;
+
+
+add_stopwords(<DATA>);
+all_pod_files_spelling_ok( qw( bin lib ) );
+__DATA__
+AFAICT
+ABEND
+RSRCHBOY
+RSRCHBOY's
+gpg
+ini
+metaclass
+metaclasses
+parameterized
+parameterization
+subclasses
+coderef
+Chris
+Weyl
+cweyl
+David
+Steinbrunner
+dsteinbrunner
+Graham
+Knop
+haarg
+lib
+MooseX
+AttributeShortcuts
@@ -0,0 +1,10 @@
+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();
@@ -0,0 +1,17 @@
+#!perl
+#
+# This file is part of MooseX-AttributeShortcuts
+#
+# 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();
@@ -0,0 +1,17 @@
+#!perl
+#
+# This file is part of MooseX-AttributeShortcuts
+#
+# 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::MinimumVersion";
+plan skip_all => "Test::MinimumVersion required for testing minimum versions"
+ if $@;
+all_minimum_version_ok( qq{5.008008} );
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+#
+# This file is part of MooseX-AttributeShortcuts
+#
+# 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();
+no_smart_comments_in_tests();
+
+done_testing();
@@ -0,0 +1,16 @@
+#!perl
+#
+# This file is part of MooseX-AttributeShortcuts
+#
+# 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
+#
+# This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests.
+
+use Test::Pod::Coverage 1.08;
+use Pod::Coverage::TrustPod;
+
+all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });
@@ -0,0 +1,29 @@
+#!perl
+#
+# This file is part of MooseX-AttributeShortcuts
+#
+# 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;
+
+foreach my $env_skip ( qw(
+ SKIP_POD_LINKCHECK
+) ){
+ plan skip_all => "\$ENV{$env_skip} is set, skipping"
+ if $ENV{$env_skip};
+}
+
+eval "use Test::Pod::LinkCheck";
+if ( $@ ) {
+ plan skip_all => 'Test::Pod::LinkCheck required for testing POD';
+}
+else {
+ Test::Pod::LinkCheck->new->all_pod_ok;
+}
@@ -0,0 +1,15 @@
+#!perl
+#
+# This file is part of MooseX-AttributeShortcuts
+#
+# 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
+#
+# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
+use Test::More;
+use Test::Pod 1.41;
+
+all_pod_files_ok();