@@ -1,5 +1,13 @@
Revision history for MooseX-OneArgNew
+0.004 2013-10-05 09:05:39 America/New_York
+ update repo and bugtracker metadata
+
+0.003 2013-04-16 16:36:26 America/New_York
+ - add a "coerce" parameter to the role; now ->new can accept one arg
+ that can be coerced to the expected type; suggested by Mark Jason
+ Dominus
+
0.002 2011-06-15 15:32:50 America/New_York
just removed the "might change radically" warning
@@ -1,4 +1,4 @@
-This software is copyright (c) 2011 by Ricardo Signes.
+This software is copyright (c) 2013 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2011 by Ricardo Signes.
+This software is Copyright (c) 2013 by Ricardo Signes.
This is free software, licensed under:
@@ -22,7 +22,7 @@ This is free software, licensed under:
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2011 by Ricardo Signes.
+This software is Copyright (c) 2013 by Ricardo Signes.
This is free software, licensed under:
@@ -7,5 +7,9 @@ Makefile.PL
README
dist.ini
lib/MooseX/OneArgNew.pm
+t/00-compile.t
+t/000-report-versions-tiny.t
t/basic.t
-t/release-pod-syntax.t
+t/coerce.t
+xt/release/changes_has_content.t
+xt/release/pod-syntax.t
@@ -4,7 +4,7 @@
"Ricardo Signes <rjbs@cpan.org>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 4.200007, CPAN::Meta::Converter version 2.110930",
+ "generated_by" : "Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132661",
"license" : [
"perl_5"
],
@@ -19,146 +19,193 @@
"ExtUtils::MakeMaker" : "6.30"
}
},
+ "develop" : {
+ "requires" : {
+ "Test::Pod" : "1.41",
+ "version" : "0.9901"
+ }
+ },
"runtime" : {
"requires" : {
- "Moose::Util::TypeConstraints" : 0,
- "MooseX::Role::Parameterized" : 0,
- "namespace::autoclean" : 0
+ "Moose::Util::TypeConstraints" : "0",
+ "MooseX::Role::Parameterized" : "0",
+ "namespace::autoclean" : "0"
}
},
"test" : {
"requires" : {
- "Moose" : 0,
- "Test::More" : "0.96"
+ "File::Spec" : "0",
+ "IO::Handle" : "0",
+ "IPC::Open3" : "0",
+ "Moose" : "0",
+ "Test::More" : "0.96",
+ "strict" : "0",
+ "warnings" : "0"
}
}
},
"release_status" : "stable",
"resources" : {
- "homepage" : "http://github.com/rjbs/moosex-oneargnew",
+ "bugtracker" : {
+ "web" : "https://github.com/rjbs/MooseX-OneArgNew/issues"
+ },
+ "homepage" : "https://github.com/rjbs/MooseX-OneArgNew",
"repository" : {
"type" : "git",
- "url" : "http://github.com/rjbs/moosex-oneargnew",
- "web" : "http://github.com/rjbs/moosex-oneargnew"
+ "url" : "https://github.com/rjbs/MooseX-OneArgNew.git",
+ "web" : "https://github.com/rjbs/MooseX-OneArgNew"
}
},
- "version" : "0.002",
+ "version" : "0.004",
"x_Dist_Zilla" : {
+ "perl" : {
+ "version" : "5.019004"
+ },
"plugins" : [
{
+ "class" : "Dist::Zilla::Plugin::Git::GatherDir",
+ "name" : "@RJBS/Git::GatherDir",
+ "version" : "2.014"
+ },
+ {
"class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed",
"name" : "@RJBS/CheckPrereqsIndexed",
- "version" : "0.003"
+ "version" : "0.009"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::CheckExtraTests",
+ "name" : "@RJBS/CheckExtraTests",
+ "version" : "0.011"
},
{
- "class" : "Dist::Zilla::Plugin::GatherDir",
- "name" : "@RJBS/@Basic/GatherDir",
- "version" : "4.200007"
+ "class" : "Dist::Zilla::Plugin::PromptIfStale",
+ "name" : "@RJBS/RJBS-Outdated",
+ "version" : "0.007"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::PromptIfStale",
+ "name" : "@RJBS/CPAN-Outdated",
+ "version" : "0.007"
},
{
"class" : "Dist::Zilla::Plugin::PruneCruft",
- "name" : "@RJBS/@Basic/PruneCruft",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/PruneCruft",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::ManifestSkip",
- "name" : "@RJBS/@Basic/ManifestSkip",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/ManifestSkip",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::MetaYAML",
- "name" : "@RJBS/@Basic/MetaYAML",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/MetaYAML",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::License",
- "name" : "@RJBS/@Basic/License",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/License",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::Readme",
- "name" : "@RJBS/@Basic/Readme",
- "version" : "4.200007"
- },
- {
- "class" : "Dist::Zilla::Plugin::ExtraTests",
- "name" : "@RJBS/@Basic/ExtraTests",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/Readme",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::ExecDir",
- "name" : "@RJBS/@Basic/ExecDir",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/ExecDir",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::ShareDir",
- "name" : "@RJBS/@Basic/ShareDir",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/ShareDir",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::MakeMaker",
- "name" : "@RJBS/@Basic/MakeMaker",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/MakeMaker",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::Manifest",
- "name" : "@RJBS/@Basic/Manifest",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/Manifest",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::TestRelease",
- "name" : "@RJBS/@Basic/TestRelease",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/TestRelease",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::ConfirmRelease",
- "name" : "@RJBS/@Basic/ConfirmRelease",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/ConfirmRelease",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::UploadToCPAN",
- "name" : "@RJBS/@Basic/UploadToCPAN",
- "version" : "4.200007"
+ "name" : "@RJBS/@Filter/UploadToCPAN",
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::AutoPrereqs",
"name" : "@RJBS/AutoPrereqs",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::Git::NextVersion",
"name" : "@RJBS/Git::NextVersion",
- "version" : "1.111460"
+ "version" : "2.014"
},
{
"class" : "Dist::Zilla::Plugin::PkgVersion",
"name" : "@RJBS/PkgVersion",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::MetaConfig",
"name" : "@RJBS/MetaConfig",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::MetaJSON",
"name" : "@RJBS/MetaJSON",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::NextRelease",
"name" : "@RJBS/NextRelease",
- "version" : "4.200007"
+ "version" : "4.300039"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent",
+ "name" : "@RJBS/Test::ChangesHasContent",
+ "version" : "0.006"
},
{
"class" : "Dist::Zilla::Plugin::PodSyntaxTests",
"name" : "@RJBS/PodSyntaxTests",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
- "class" : "Dist::Zilla::Plugin::Repository",
- "name" : "@RJBS/Repository",
- "version" : "0.18"
+ "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny",
+ "name" : "@RJBS/ReportVersions::Tiny",
+ "version" : "1.10"
+ },
+ {
+ "class" : "Dist::Zilla::Plugin::Test::Compile",
+ "config" : {
+ "Dist::Zilla::Plugin::Test::Compile" : {
+ "module_finder" : [
+ ":InstallModules"
+ ],
+ "script_finder" : [
+ ":ExecFiles"
+ ]
+ }
+ },
+ "name" : "@RJBS/Test::Compile",
+ "version" : "2.033"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
@@ -169,75 +216,84 @@
}
},
"name" : "@RJBS/TestMoreWithSubtests",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::PodWeaver",
+ "config" : {
+ "Dist::Zilla::Plugin::PodWeaver" : {
+ "config_plugin" : "@RJBS",
+ "finder" : [
+ ":InstallModules",
+ ":ExecFiles"
+ ]
+ }
+ },
"name" : "@RJBS/PodWeaver",
- "version" : "3.101641"
+ "version" : "3.102000"
},
{
"class" : "Dist::Zilla::Plugin::GithubMeta",
"name" : "@RJBS/GithubMeta",
- "version" : "0.12"
+ "version" : "0.42"
},
{
"class" : "Dist::Zilla::Plugin::Git::Check",
"name" : "@RJBS/@Git/Check",
- "version" : "1.111460"
+ "version" : "2.014"
},
{
"class" : "Dist::Zilla::Plugin::Git::Commit",
"name" : "@RJBS/@Git/Commit",
- "version" : "1.111460"
+ "version" : "2.014"
},
{
"class" : "Dist::Zilla::Plugin::Git::Tag",
"name" : "@RJBS/@Git/Tag",
- "version" : "1.111460"
+ "version" : "2.014"
},
{
"class" : "Dist::Zilla::Plugin::Git::Push",
"name" : "@RJBS/@Git/Push",
- "version" : "1.111460"
+ "version" : "2.014"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":InstallModules",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":IncModules",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":TestFiles",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExecFiles",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ShareFiles",
- "version" : "4.200007"
+ "version" : "4.300039"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":MainModule",
- "version" : "4.200007"
+ "version" : "4.300039"
}
],
"zilla" : {
"class" : "Dist::Zilla::Dist::Builder",
"config" : {
- "is_trial" : 0
+ "is_trial" : "0"
},
- "version" : "4.200007"
+ "version" : "4.300039"
}
}
}
@@ -3,12 +3,17 @@ abstract: 'teach ->new to accept single, non-hashref arguments'
author:
- 'Ricardo Signes <rjbs@cpan.org>'
build_requires:
+ File::Spec: 0
+ IO::Handle: 0
+ IPC::Open3: 0
Moose: 0
Test::More: 0.96
+ strict: 0
+ warnings: 0
configure_requires:
ExtUtils::MakeMaker: 6.30
dynamic_config: 0
-generated_by: 'Dist::Zilla version 4.200007, CPAN::Meta::Converter version 2.110930'
+generated_by: 'Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.132661'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -19,103 +24,128 @@ requires:
MooseX::Role::Parameterized: 0
namespace::autoclean: 0
resources:
- homepage: http://github.com/rjbs/moosex-oneargnew
- repository: http://github.com/rjbs/moosex-oneargnew
-version: 0.002
+ bugtracker: https://github.com/rjbs/MooseX-OneArgNew/issues
+ homepage: https://github.com/rjbs/MooseX-OneArgNew
+ repository: https://github.com/rjbs/MooseX-OneArgNew.git
+version: 0.004
x_Dist_Zilla:
+ perl:
+ version: 5.019004
plugins:
-
+ class: Dist::Zilla::Plugin::Git::GatherDir
+ name: '@RJBS/Git::GatherDir'
+ version: 2.014
+ -
class: Dist::Zilla::Plugin::CheckPrereqsIndexed
name: '@RJBS/CheckPrereqsIndexed'
- version: 0.003
+ version: 0.009
+ -
+ class: Dist::Zilla::Plugin::CheckExtraTests
+ name: '@RJBS/CheckExtraTests'
+ version: 0.011
-
- class: Dist::Zilla::Plugin::GatherDir
- name: '@RJBS/@Basic/GatherDir'
- version: 4.200007
+ class: Dist::Zilla::Plugin::PromptIfStale
+ name: '@RJBS/RJBS-Outdated'
+ version: 0.007
+ -
+ class: Dist::Zilla::Plugin::PromptIfStale
+ name: '@RJBS/CPAN-Outdated'
+ version: 0.007
-
class: Dist::Zilla::Plugin::PruneCruft
- name: '@RJBS/@Basic/PruneCruft'
- version: 4.200007
+ name: '@RJBS/@Filter/PruneCruft'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::ManifestSkip
- name: '@RJBS/@Basic/ManifestSkip'
- version: 4.200007
+ name: '@RJBS/@Filter/ManifestSkip'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::MetaYAML
- name: '@RJBS/@Basic/MetaYAML'
- version: 4.200007
+ name: '@RJBS/@Filter/MetaYAML'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::License
- name: '@RJBS/@Basic/License'
- version: 4.200007
+ name: '@RJBS/@Filter/License'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::Readme
- name: '@RJBS/@Basic/Readme'
- version: 4.200007
- -
- class: Dist::Zilla::Plugin::ExtraTests
- name: '@RJBS/@Basic/ExtraTests'
- version: 4.200007
+ name: '@RJBS/@Filter/Readme'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::ExecDir
- name: '@RJBS/@Basic/ExecDir'
- version: 4.200007
+ name: '@RJBS/@Filter/ExecDir'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::ShareDir
- name: '@RJBS/@Basic/ShareDir'
- version: 4.200007
+ name: '@RJBS/@Filter/ShareDir'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::MakeMaker
- name: '@RJBS/@Basic/MakeMaker'
- version: 4.200007
+ name: '@RJBS/@Filter/MakeMaker'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::Manifest
- name: '@RJBS/@Basic/Manifest'
- version: 4.200007
+ name: '@RJBS/@Filter/Manifest'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::TestRelease
- name: '@RJBS/@Basic/TestRelease'
- version: 4.200007
+ name: '@RJBS/@Filter/TestRelease'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::ConfirmRelease
- name: '@RJBS/@Basic/ConfirmRelease'
- version: 4.200007
+ name: '@RJBS/@Filter/ConfirmRelease'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::UploadToCPAN
- name: '@RJBS/@Basic/UploadToCPAN'
- version: 4.200007
+ name: '@RJBS/@Filter/UploadToCPAN'
+ version: 4.300039
-
class: Dist::Zilla::Plugin::AutoPrereqs
name: '@RJBS/AutoPrereqs'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::Git::NextVersion
name: '@RJBS/Git::NextVersion'
- version: 1.111460
+ version: 2.014
-
class: Dist::Zilla::Plugin::PkgVersion
name: '@RJBS/PkgVersion'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::MetaConfig
name: '@RJBS/MetaConfig'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::MetaJSON
name: '@RJBS/MetaJSON'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::NextRelease
name: '@RJBS/NextRelease'
- version: 4.200007
+ version: 4.300039
+ -
+ class: Dist::Zilla::Plugin::Test::ChangesHasContent
+ name: '@RJBS/Test::ChangesHasContent'
+ version: 0.006
-
class: Dist::Zilla::Plugin::PodSyntaxTests
name: '@RJBS/PodSyntaxTests'
- version: 4.200007
+ version: 4.300039
+ -
+ class: Dist::Zilla::Plugin::ReportVersions::Tiny
+ name: '@RJBS/ReportVersions::Tiny'
+ version: 1.10
-
- class: Dist::Zilla::Plugin::Repository
- name: '@RJBS/Repository'
- version: 0.18
+ class: Dist::Zilla::Plugin::Test::Compile
+ config:
+ Dist::Zilla::Plugin::Test::Compile:
+ module_finder:
+ - ':InstallModules'
+ script_finder:
+ - ':ExecFiles'
+ name: '@RJBS/Test::Compile'
+ version: 2.033
-
class: Dist::Zilla::Plugin::Prereqs
config:
@@ -123,57 +153,63 @@ x_Dist_Zilla:
phase: test
type: requires
name: '@RJBS/TestMoreWithSubtests'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::PodWeaver
+ config:
+ Dist::Zilla::Plugin::PodWeaver:
+ config_plugin: '@RJBS'
+ finder:
+ - ':InstallModules'
+ - ':ExecFiles'
name: '@RJBS/PodWeaver'
- version: 3.101641
+ version: 3.102000
-
class: Dist::Zilla::Plugin::GithubMeta
name: '@RJBS/GithubMeta'
- version: 0.12
+ version: 0.42
-
class: Dist::Zilla::Plugin::Git::Check
name: '@RJBS/@Git/Check'
- version: 1.111460
+ version: 2.014
-
class: Dist::Zilla::Plugin::Git::Commit
name: '@RJBS/@Git/Commit'
- version: 1.111460
+ version: 2.014
-
class: Dist::Zilla::Plugin::Git::Tag
name: '@RJBS/@Git/Tag'
- version: 1.111460
+ version: 2.014
-
class: Dist::Zilla::Plugin::Git::Push
name: '@RJBS/@Git/Push'
- version: 1.111460
+ version: 2.014
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::FinderCode
name: ':IncModules'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
- version: 4.200007
+ version: 4.300039
-
class: Dist::Zilla::Plugin::FinderCode
name: ':MainModule'
- version: 4.200007
+ version: 4.300039
zilla:
class: Dist::Zilla::Dist::Builder
config:
is_trial: 0
- version: 4.200007
+ version: 4.300039
@@ -9,31 +9,50 @@ use ExtUtils::MakeMaker 6.30;
my %WriteMakefileArgs = (
- 'ABSTRACT' => 'teach ->new to accept single, non-hashref arguments',
- 'AUTHOR' => 'Ricardo Signes <rjbs@cpan.org>',
- 'BUILD_REQUIRES' => {
- 'Moose' => '0',
- 'Test::More' => '0.96'
+ "ABSTRACT" => "teach ->new to accept single, non-hashref arguments",
+ "AUTHOR" => "Ricardo Signes <rjbs\@cpan.org>",
+ "BUILD_REQUIRES" => {},
+ "CONFIGURE_REQUIRES" => {
+ "ExtUtils::MakeMaker" => "6.30"
},
- 'CONFIGURE_REQUIRES' => {
- 'ExtUtils::MakeMaker' => '6.30'
+ "DISTNAME" => "MooseX-OneArgNew",
+ "EXE_FILES" => [],
+ "LICENSE" => "perl",
+ "NAME" => "MooseX::OneArgNew",
+ "PREREQ_PM" => {
+ "Moose::Util::TypeConstraints" => 0,
+ "MooseX::Role::Parameterized" => 0,
+ "namespace::autoclean" => 0
},
- 'DISTNAME' => 'MooseX-OneArgNew',
- 'EXE_FILES' => [],
- 'LICENSE' => 'perl',
- 'NAME' => 'MooseX::OneArgNew',
- 'PREREQ_PM' => {
- 'Moose::Util::TypeConstraints' => '0',
- 'MooseX::Role::Parameterized' => '0',
- 'namespace::autoclean' => '0'
+ "TEST_REQUIRES" => {
+ "File::Spec" => 0,
+ "IO::Handle" => 0,
+ "IPC::Open3" => 0,
+ "Moose" => 0,
+ "Test::More" => "0.96",
+ "strict" => 0,
+ "warnings" => 0
},
- 'VERSION' => '0.002',
- 'test' => {
- 'TESTS' => 't/*.t'
+ "VERSION" => "0.004",
+ "test" => {
+ "TESTS" => "t/*.t"
}
);
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
+ my $tr = delete $WriteMakefileArgs{TEST_REQUIRES};
+ my $br = $WriteMakefileArgs{BUILD_REQUIRES};
+ for my $mod ( keys %$tr ) {
+ if ( exists $br->{$mod} ) {
+ $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod};
+ }
+ else {
+ $br->{$mod} = $tr->{$mod};
+ }
+ }
+}
+
unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
my $pp = $WriteMakefileArgs{PREREQ_PM};
@@ -1,11 +1,11 @@
This archive contains the distribution MooseX-OneArgNew,
-version 0.002:
+version 0.004:
teach ->new to accept single, non-hashref arguments
-This software is copyright (c) 2011 by Ricardo Signes.
+This software is copyright (c) 2013 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -1,6 +1,6 @@
package MooseX::OneArgNew;
-BEGIN {
- $MooseX::OneArgNew::VERSION = '0.002';
+{
+ $MooseX::OneArgNew::VERSION = '0.004';
}
use MooseX::Role::Parameterized;
# ABSTRACT: teach ->new to accept single, non-hashref arguments
@@ -23,6 +23,11 @@ parameter type => (
required => 1,
);
+parameter coerce => (
+ isa => 'Bool',
+ default => 0,
+);
+
parameter init_arg => (
isa => 'Str',
required => 1,
@@ -36,15 +41,17 @@ role {
my $self = shift;
return $self->$orig(@_) unless @_ == 1;
- return $self->$orig(@_) unless $p->type->check($_[0]);
+ my $value = $p->coerce ? $p->type->coerce($_[0]) : $_[0];
+ return $self->$orig(@_) unless $p->type->check($value);
- return { $p->init_arg => $_[0] }
+ return { $p->init_arg => $value }
};
};
1;
__END__
+
=pod
=head1 NAME
@@ -53,7 +60,7 @@ MooseX::OneArgNew - teach ->new to accept single, non-hashref arguments
=head1 VERSION
-version 0.002
+version 0.004
=head1 SYNOPSIS
@@ -94,7 +101,7 @@ When making a message:
MooseX::OneArgNew lets your constructor take a single argument, which will be
translated into the value for a one-entry hashref. It is a L<parameterized
-role|MooseX::Role::Parameterized> with two parameters:
+role|MooseX::Role::Parameterized> with three parameters:
=over 4
@@ -109,6 +116,13 @@ MooseX::Type.
This is the string that will be used as the key for the hashref constructed
from the one-arg call to new.
+=item coerce
+
+If true, a single argument to new will be coerced into the expected type if
+possible. Keep in mind that if there are no coercions for the type, this will
+be an error, and that if a coercion from HashRef exists, you might be getting
+yourself into a weird situation.
+
=back
=head2 WARNINGS
@@ -126,10 +140,9 @@ Ricardo Signes <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE
-This software is copyright (c) 2011 by Ricardo Signes.
+This software is copyright (c) 2013 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
-
@@ -0,0 +1,46 @@
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.033
+
+use Test::More 0.94 tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
+
+
+
+my @module_files = (
+ 'MooseX/OneArgNew.pm'
+);
+
+
+
+# no fake home requested
+
+use File::Spec;
+use IPC::Open3;
+use IO::Handle;
+
+my @warnings;
+for my $lib (@module_files)
+{
+ # see L<perlfaq8/How can I capture STDERR from an external command?>
+ open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
+ my $stderr = IO::Handle->new;
+
+ my $pid = open3($stdin, '>&STDERR', $stderr, $^X, '-Mblib', '-e', "require q[$lib]");
+ binmode $stderr, ':crlf' if $^O eq 'MSWin32';
+ my @_warnings = <$stderr>;
+ waitpid($pid, 0);
+ is($? >> 8, 0, "$lib loaded ok");
+
+ if (@_warnings)
+ {
+ warn @_warnings;
+ push @warnings, @_warnings;
+ }
+}
+
+
+
+is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING};
+
+BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing;
@@ -0,0 +1,80 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+# This is a relatively nice way to avoid Test::NoWarnings breaking our
+# expectations by adding extra tests, without using no_plan. It also helps
+# avoid any other test module that feels introducing random tests, or even
+# test plans, is a nice idea.
+our $success = 0;
+END { $success && done_testing; }
+
+# List our own version used to generate this
+my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.10\n";
+
+eval { # no excuses!
+ # report our Perl details
+ my $want = "any version";
+ $v .= "perl: $] (wanted $want) on $^O from $^X\n\n";
+};
+defined($@) and diag("$@");
+
+# Now, our module version dependencies:
+sub pmver {
+ my ($module, $wanted) = @_;
+ $wanted = " (want $wanted)";
+ my $pmver;
+ eval "require $module;";
+ if ($@) {
+ if ($@ =~ m/Can't locate .* in \@INC/) {
+ $pmver = 'module not found.';
+ } else {
+ diag("${module}: $@");
+ $pmver = 'died during require.';
+ }
+ } else {
+ my $version;
+ eval { $version = $module->VERSION; };
+ if ($@) {
+ diag("${module}: $@");
+ $pmver = 'died during VERSION check.';
+ } elsif (defined $version) {
+ $pmver = "$version";
+ } else {
+ $pmver = '<undef>';
+ }
+ }
+
+ # So, we should be good, right?
+ return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n");
+}
+
+eval { $v .= pmver('ExtUtils::MakeMaker','6.30') };
+eval { $v .= pmver('File::Spec','any version') };
+eval { $v .= pmver('IO::Handle','any version') };
+eval { $v .= pmver('IPC::Open3','any version') };
+eval { $v .= pmver('Moose','any version') };
+eval { $v .= pmver('Moose::Util::TypeConstraints','any version') };
+eval { $v .= pmver('MooseX::Role::Parameterized','any version') };
+eval { $v .= pmver('Test::More','0.96') };
+eval { $v .= pmver('namespace::autoclean','any version') };
+eval { $v .= pmver('strict','any version') };
+eval { $v .= pmver('warnings','any version') };
+
+
+# All done.
+$v .= <<'EOT';
+
+Thanks for using my code. I hope it works for you.
+If not, please try and include this output in the bug report.
+That will help me reproduce the issue and solve your problem.
+
+EOT
+
+diag($v);
+ok(1, "we really didn't test anything, just reporting data");
+$success = 1;
+
+# Work around another nasty module on CPAN. :/
+no warnings 'once';
+$Template::Test::NO_FLUSH = 1;
+exit 0;
@@ -0,0 +1,53 @@
+use strict;
+use warnings;
+
+use Test::More 0.96;
+
+{
+ package TypeHolder;
+ use Moose::Util::TypeConstraints;
+ subtype 'Exes', as 'Str', where { length > 0 && $_ !~ /[^X]/ };
+ subtype 'XL', as 'Int';
+ coerce 'XL', from 'Exes', via { length };
+}
+
+{
+ package Object;
+ use Moose;
+ with(
+ 'MooseX::OneArgNew' => {
+ type => 'XL',
+ init_arg => 'size',
+ coerce => 1,
+ },
+ );
+
+ has size => (is => 'ro', isa => 'XL');
+}
+
+{
+ my $obj = Object->new('XXX');
+ isa_ok($obj, 'Object');
+ is($obj->size, 3, "coercing one-arg-new worked");
+}
+
+{
+ my $obj = Object->new({ size => 10 });
+ isa_ok($obj, 'Object');
+ is($obj->size, 10, "hashref args to ->new worked");
+}
+
+{
+ my $obj = Object->new(size => 10);
+ isa_ok($obj, 'Object');
+ is($obj->size, 10, "pair args to ->new worked");
+}
+
+{
+ my $obj = eval { Object->new('ten') };
+ my $err = $@;
+ ok(! $obj, "couldn't construct Object with non-{} non-Int single-arg new");
+ like($err, qr/parameters to new/, "...error message seems plausible");
+}
+
+done_testing;
@@ -1,15 +0,0 @@
-#!perl
-
-BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate testing');
- }
-}
-
-use Test::More;
-
-eval "use Test::Pod 1.41";
-plan skip_all => "Test::Pod 1.41 required for testing POD" if $@;
-
-all_pod_files_ok();
@@ -0,0 +1,41 @@
+#!perl
+
+use Test::More tests => 2;
+
+note 'Checking Changes';
+my $changes_file = 'Changes';
+my $newver = '0.004';
+my $trial_token = '-TRIAL';
+
+SKIP: {
+ ok(-e $changes_file, "$changes_file file exists")
+ or skip 'Changes is missing', 1;
+
+ ok(_get_changes($newver), "$changes_file has content for $newver");
+}
+
+done_testing;
+
+# _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit
+# by Jerome Quelin
+sub _get_changes
+{
+ my $newver = shift;
+
+ # parse changelog to find commit message
+ open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!";
+ my $changelog = join('', <$fh>);
+ close $fh;
+
+ my @content =
+ grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented
+ split /\n/, $changelog;
+ shift @content; # drop the version line
+
+ # drop unindented last line and trailing blank lines
+ pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ );
+
+ # return number of non-blank lines
+ return scalar @content;
+}
+
@@ -0,0 +1,7 @@
+#!perl
+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();