summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2023-11-18 02:03:23 +0100
committergregor herrmann <gregoa@debian.org>2023-11-18 02:03:23 +0100
commitc71da244227848fd9bef4fe281819c758c1823c3 (patch)
treecbbf41b2107349d5808e788e50ddac53070d4e13
parent77b1647cc5e1b6bf78176c1f01ea32d838283642 (diff)
parentdd491671ea938aec5fc92436e300cb7acf3e98f4 (diff)
Update upstream source from tag 'upstream/0.005'
Update to upstream version '0.005' with Debian dir 660bd0095b2fa564f4a94784e8bd5d897a9c35d6
-rw-r--r--Changes6
-rw-r--r--INSTALL43
-rw-r--r--LICENSE183
-rw-r--r--MANIFEST20
-rw-r--r--META.json67
-rw-r--r--META.yml34
-rw-r--r--Makefile.PL25
-rw-r--r--README101
-rw-r--r--SIGNATURE50
-rw-r--r--cpanfile2
-rw-r--r--dist.ini68
-rw-r--r--lib/Variable/Disposition.pm40
-rw-r--r--lib/Variable/Disposition.pod12
-rw-r--r--t/00-check-deps.t2
-rw-r--r--t/00-compile.t15
-rw-r--r--t/00-report-prereqs.dd46
-rw-r--r--t/00-report-prereqs.t197
-rw-r--r--t/000-report-versions-tiny.t78
-rw-r--r--t/basic.t62
-rw-r--r--t/retain.t16
-rw-r--r--t/retain_future.t24
-rw-r--r--xt/author/distmeta.t7
-rw-r--r--xt/author/eol.t32
-rw-r--r--xt/author/minimum-version.t6
-rw-r--r--xt/author/mojibake.t9
-rw-r--r--xt/author/no-tabs.t32
-rw-r--r--xt/author/pod-syntax.t (renamed from xt/release/pod-syntax.t)1
-rw-r--r--xt/author/portability.t8
-rw-r--r--xt/author/test-version.t (renamed from xt/release/test-version.t)11
-rw-r--r--xt/release/cpan-changes.t10
-rw-r--r--xt/release/mojibake.t12
-rw-r--r--xt/release/synopsis.t5
32 files changed, 752 insertions, 472 deletions
diff --git a/Changes b/Changes
index 4ccf218..5719a6d 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,11 @@
Revision history for Variable-Disposition
+0.005 2023-11-16 03:00:57+08:00 Asia/Singapore
+ [Bugs fixed]
+
+ - when Future::XS is installed, t/retain_future.t failed due to attempting
+ to pass a value to `->cancel`, thanks to ANDK for reporting
+
0.004 2015-02-11 22:17:44+00:00 Europe/London
No new features.
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 18233a5..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,43 +0,0 @@
-This is the Perl distribution Variable-Disposition.
-
-Installing Variable-Disposition is straightforward.
-
-## Installation with cpanm
-
-If you have cpanm, you only need one line:
-
- % cpanm Variable::Disposition
-
-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 Variable::Disposition
-
-## Installing with the CPAN shell
-
-Alternatively, if your CPAN shell is set up, you should just be able to do:
-
- % cpan Variable::Disposition
-
-## 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
-
-Variable-Disposition documentation is available as POD.
-You can run perldoc from a shell to read the documentation:
-
- % perldoc Variable::Disposition
diff --git a/LICENSE b/LICENSE
index eeed8ba..af22398 100644
--- a/LICENSE
+++ b/LICENSE
@@ -270,110 +270,143 @@ necessary. Here a sample; alter the names:
That's all there is to it!
---- The Artistic License 1.0 ---
+--- The Perl Artistic License 1.0 ---
This software is Copyright (c) 2014 by Tom Molesworth.
This is free software, licensed under:
- The Artistic License 1.0
+ The Perl Artistic License 1.0
-The Artistic License
-Preamble
-The intent of this document is to state the conditions under which a Package
-may be copied, such that the Copyright Holder maintains some semblance of
-artistic control over the development of the package, while giving the users of
-the package the right to use and distribute the Package in a more-or-less
-customary fashion, plus the right to make reasonable modifications.
+
+
+ The "Artistic License"
+
+ Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
Definitions:
- - "Package" refers to the collection of files distributed by the Copyright
- Holder, and derivatives of that collection of files created through
- textual modification.
- - "Standard Version" refers to such a Package if it has not been modified,
- or has been modified in accordance with the wishes of the Copyright
- Holder.
- - "Copyright Holder" is whoever is named in the copyright or copyrights for
- the package.
- - "You" is you, if you're thinking about copying or distributing this Package.
- - "Reasonable copying fee" is whatever you can justify on the basis of media
- cost, duplication charges, time of people involved, and so on. (You will
- not be required to justify it to the Copyright Holder, but only to the
- computing community at large as a market that must bear the fee.)
- - "Freely Available" means that no fee is charged for the item itself, though
- there may be fees involved in handling the item. It also means that
- recipients of the item may redistribute it under the same conditions they
- received it.
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes
+ of the Copyright Holder as specified below.
+
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package.
+
+ "You" is you, if you're thinking about copying or distributing
+ this Package.
+
+ "Reasonable copying fee" is whatever you can justify on the
+ basis of media cost, duplication charges, time of people involved,
+ and so on. (You will not be required to justify it to the
+ Copyright Holder, but only to the computing community at large
+ as a market that must bear the fee.)
+
+ "Freely Available" means that no fee is charged for the item
+ itself, though there may be fees involved in handling the item.
+ It also means that recipients of the item may redistribute it
+ under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
-2. You may apply bug fixes, portability fixes and other modifications derived
-from the Public Domain or from the Copyright Holder. A Package modified in such
-a way shall still be considered the Standard Version.
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain or from the Copyright Holder. A Package
+modified in such a way shall still be considered the Standard Version.
-3. You may otherwise modify your copy of this Package in any way, provided that
-you insert a prominent notice in each changed file stating how and when you
-changed that file, and provided that you do at least ONE of the following:
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
- a) place your modifications in the Public Domain or otherwise make them
- Freely Available, such as by posting said modifications to Usenet or an
- equivalent medium, or placing the modifications on a major archive site
- such as ftp.uu.net, or by allowing the Copyright Holder to include your
- modifications in the Standard Version of the Package.
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or
+ an equivalent medium, or placing the modifications on a major archive
+ site such as uunet.uu.net, or by allowing the Copyright Holder to include
+ your modifications in the Standard Version of the Package.
- b) use the modified Package only within your corporation or organization.
+ b) use the modified Package only within your corporation or organization.
- c) rename any non-standard executables so the names do not conflict with
- standard executables, which must also be provided, and provide a separate
- manual page for each non-standard executable that clearly documents how it
- differs from the Standard Version.
+ c) rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided, and provide
+ a separate manual page for each non-standard executable that clearly
+ documents how it differs from the Standard Version.
- d) make other distribution arrangements with the Copyright Holder.
+ d) make other distribution arrangements with the Copyright Holder.
-4. You may distribute the programs of this Package in object code or executable
-form, provided that you do at least ONE of the following:
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
- a) distribute a Standard Version of the executables and library files,
- together with instructions (in the manual page or equivalent) on where to
- get the Standard Version.
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where
+ to get the Standard Version.
- b) accompany the distribution with the machine-readable source of the Package
- with your modifications.
+ b) accompany the distribution with the machine-readable source of
+ the Package with your modifications.
- c) accompany any non-standard executables with their corresponding Standard
- Version executables, giving the non-standard executables non-standard
- names, and clearly documenting the differences in manual pages (or
- equivalent), together with instructions on where to get the Standard
- Version.
+ c) give non-standard executables non-standard names, and clearly
+ document the differences in manual pages (or equivalent), together
+ with instructions on where to get the Standard Version.
- d) make other distribution arrangements with the Copyright Holder.
+ d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
-Package. You may charge any fee you choose for support of this Package. You
-may not charge a fee for this Package itself. However, you may distribute this
-Package in aggregate with other (possibly commercial) programs as part of a
-larger (possibly commercial) software distribution provided that you do not
-advertise this Package as a product of your own.
-
-6. The scripts and library files supplied as input to or produced as output
-from the programs of this Package do not automatically fall under the copyright
-of this Package, but belong to whomever generated them, and may be sold
-commercially, and may be aggregated with this Package.
-
-7. C or perl subroutines supplied by you and linked into this Package shall not
-be considered part of this Package.
-
-8. The name of the Copyright Holder may not be used to endorse or promote
+Package. You may charge any fee you choose for support of this
+Package. You may not charge a fee for this Package itself. However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial) software
+distribution provided that you do not advertise this Package as a
+product of your own. You may embed this Package's interpreter within
+an executable of yours (by linking); this shall be construed as a mere
+form of aggregation, provided that the complete Standard Version of the
+interpreter is so embedded.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whoever generated
+them, and may be sold commercially, and may be aggregated with this
+Package. If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of this
+Package.
+
+7. C subroutines (or comparably compiled subroutines in other
+languages) supplied by you and linked into this Package in order to
+emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. Aggregation of this Package with a commercial distribution is always
+permitted provided that the use of this Package is embedded; that is,
+when no overt attempt is made to make this Package's interfaces visible
+to the end user of the commercial distribution. Such use shall not be
+construed as a distribution of this Package.
+
+9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
-9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-The End
+ The End
diff --git a/MANIFEST b/MANIFEST
index 621c7cb..e0ddda8 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,25 +1,29 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.029.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.030.
Changes
-INSTALL
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
-SIGNATURE
cpanfile
dist.ini
lib/Variable/Disposition.pm
lib/Variable/Disposition.pod
t/00-check-deps.t
t/00-compile.t
-t/000-report-versions-tiny.t
+t/00-report-prereqs.dd
+t/00-report-prereqs.t
t/basic.t
t/retain.t
t/retain_future.t
+xt/author/distmeta.t
+xt/author/eol.t
+xt/author/minimum-version.t
+xt/author/mojibake.t
+xt/author/no-tabs.t
+xt/author/pod-syntax.t
+xt/author/portability.t
+xt/author/test-version.t
xt/release/common_spelling.t
-xt/release/mojibake.t
-xt/release/pod-syntax.t
-xt/release/synopsis.t
-xt/release/test-version.t
+xt/release/cpan-changes.t
diff --git a/META.json b/META.json
index 94b7ffd..e701aec 100644
--- a/META.json
+++ b/META.json
@@ -1,10 +1,10 @@
{
"abstract" : "dispose of variables",
"author" : [
- "Tom Molesworth <cpan@perlsite.co.uk>"
+ "Tom Molesworth <TEAM@cpan.org>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 5.029, CPAN::Meta::Converter version 2.143240",
+ "generated_by" : "Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
@@ -13,33 +13,49 @@
"version" : 2
},
"name" : "Variable-Disposition",
+ "no_index" : {
+ "directory" : [
+ "eg",
+ "share",
+ "shares",
+ "t",
+ "xt"
+ ]
+ },
"prereqs" : {
- "build" : {
- "requires" : {
- "perl" : "5.010001"
- }
- },
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : "6.48"
+ "ExtUtils::MakeMaker" : "0"
}
},
"develop" : {
"requires" : {
- "Test::More" : "0",
+ "Dist::Zilla" : "5",
+ "Dist::Zilla::PluginBundle::Author::TEAM" : "0",
+ "Software::License::Perl_5" : "0",
+ "Test::CPAN::Changes" : "0.19",
+ "Test::CPAN::Meta" : "0",
+ "Test::EOL" : "0",
+ "Test::MinimumVersion" : "0",
+ "Test::Mojibake" : "0",
+ "Test::More" : "0.88",
+ "Test::NoTabs" : "0",
"Test::Pod" : "1.41",
- "Test::Synopsis" : "0",
- "Test::Version" : "1",
- "version" : "0.9901"
+ "Test::Portability::Files" : "0",
+ "Test::Version" : "1"
}
},
"runtime" : {
"requires" : {
- "Future" : "0.30"
+ "Future" : "0.36"
}
},
"test" : {
+ "recommends" : {
+ "CPAN::Meta" : "2.120900"
+ },
"requires" : {
+ "ExtUtils::MakeMaker" : "0",
"File::Spec" : "0",
"IO::Handle" : "0",
"IPC::Open3" : "0",
@@ -50,14 +66,31 @@
}
}
},
+ "provides" : {
+ "Variable::Disposition" : {
+ "file" : "lib/Variable/Disposition.pm",
+ "version" : "0.005"
+ }
+ },
"release_status" : "stable",
"resources" : {
"bugtracker" : {
- "mailto" : "bug-variable-disposition at rt.cpan.org",
- "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Variable-Disposition"
+ "web" : "https://github.com/team-at-cpan/Variable-Disposition/issues"
},
- "homepage" : "http://search.cpan.org/dist/Variable-Disposition/"
+ "homepage" : "https://github.com/team-at-cpan/Variable-Disposition",
+ "repository" : {
+ "type" : "git",
+ "url" : "https://github.com/team-at-cpan/Variable-Disposition.git",
+ "web" : "https://github.com/team-at-cpan/Variable-Disposition"
+ }
},
- "version" : "0.004"
+ "version" : "0.005",
+ "x_authority" : "cpan:TEAM",
+ "x_contributors" : [
+ "Tom Molesworth <tom@perlsite.co.uk>"
+ ],
+ "x_generated_by_perl" : "v5.38.0",
+ "x_serialization_backend" : "Cpanel::JSON::XS version 4.37",
+ "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later"
}
diff --git a/META.yml b/META.yml
index 1224895..0a08ddc 100644
--- a/META.yml
+++ b/META.yml
@@ -1,8 +1,9 @@
---
abstract: 'dispose of variables'
author:
- - 'Tom Molesworth <cpan@perlsite.co.uk>'
+ - 'Tom Molesworth <TEAM@cpan.org>'
build_requires:
+ ExtUtils::MakeMaker: '0'
File::Spec: '0'
IO::Handle: '0'
IPC::Open3: '0'
@@ -10,19 +11,36 @@ build_requires:
Test::Fatal: '0.010'
Test::More: '0.98'
Test::Refcount: '0'
- perl: '5.010001'
configure_requires:
- ExtUtils::MakeMaker: '6.48'
+ ExtUtils::MakeMaker: '0'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.029, CPAN::Meta::Converter version 2.143240'
+generated_by: 'Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Variable-Disposition
+no_index:
+ directory:
+ - eg
+ - share
+ - shares
+ - t
+ - xt
+provides:
+ Variable::Disposition:
+ file: lib/Variable/Disposition.pm
+ version: '0.005'
requires:
- Future: '0.30'
+ Future: '0.36'
resources:
- bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Variable-Disposition
- homepage: http://search.cpan.org/dist/Variable-Disposition/
-version: '0.004'
+ bugtracker: https://github.com/team-at-cpan/Variable-Disposition/issues
+ homepage: https://github.com/team-at-cpan/Variable-Disposition
+ repository: https://github.com/team-at-cpan/Variable-Disposition.git
+version: '0.005'
+x_authority: cpan:TEAM
+x_contributors:
+ - 'Tom Molesworth <tom@perlsite.co.uk>'
+x_generated_by_perl: v5.38.0
+x_serialization_backend: 'YAML::Tiny version 1.74'
+x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'
diff --git a/Makefile.PL b/Makefile.PL
index 9ab7b51..48c2b0b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,29 +1,25 @@
-
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.029.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.030.
use strict;
use warnings;
-use 5.010001;
-
-use ExtUtils::MakeMaker 6.48;
+use ExtUtils::MakeMaker;
my %WriteMakefileArgs = (
"ABSTRACT" => "dispose of variables",
- "AUTHOR" => "Tom Molesworth <cpan\@perlsite.co.uk>",
+ "AUTHOR" => "Tom Molesworth <TEAM\@cpan.org>",
"CONFIGURE_REQUIRES" => {
- "ExtUtils::MakeMaker" => "6.48"
+ "ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "Variable-Disposition",
- "EXE_FILES" => [],
"LICENSE" => "perl",
- "MIN_PERL_VERSION" => "5.010001",
"NAME" => "Variable::Disposition",
"PREREQ_PM" => {
- "Future" => "0.30"
+ "Future" => "0.36"
},
"TEST_REQUIRES" => {
+ "ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
@@ -32,7 +28,7 @@ my %WriteMakefileArgs = (
"Test::More" => "0.98",
"Test::Refcount" => 0
},
- "VERSION" => "0.004",
+ "VERSION" => "0.005",
"test" => {
"TESTS" => "t/*.t"
}
@@ -40,9 +36,9 @@ my %WriteMakefileArgs = (
my %FallbackPrereqs = (
- "ExtUtils::MakeMaker" => "6.48",
+ "ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
- "Future" => "0.30",
+ "Future" => "0.36",
"IO::Handle" => 0,
"IPC::Open3" => 0,
"Test::CheckDeps" => "0.010",
@@ -62,6 +58,3 @@ delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
-
-
-
diff --git a/README b/README
index 669593f..141b85b 100644
--- a/README
+++ b/README
@@ -1,15 +1,102 @@
+NAME
+ Variable::Disposition - helper functions for disposing of variables
-This archive contains the distribution Variable-Disposition,
-version 0.004:
+SYNOPSIS
- dispose of variables
+ use feature qw(say);
+ use Variable::Disposition;
+ my $x = [];
+ dispose $x;
+ say '$x is no longer defined';
-This software is copyright (c) 2014 by Tom Molesworth.
+DESCRIPTION
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
+ Provides some basic helper functions for making sure variables go away
+ when you want them to.
+ Currently provides "dispose" as a default import. To avoid this:
-This README file was generated by Dist::Zilla::Plugin::Readme v5.029.
+ use Variable::Disposition ();
+
+ In addition, "retain" and "retain_future" are available as optional
+ imports.
+
+ use Variable::Disposition qw(dispose retain retain_future);
+
+ The :all tag can be used to import every available function:
+
+ use Variable::Disposition qw(:all);
+
+ but it would be safer to use a version instead:
+
+ use Variable::Disposition qw(:v1);
+
+ since these are guaranteed not to change in future.
+
+ Other functions for use with Future and IO::Async are likely to be
+ added later.
+
+FUNCTIONS
+
+ dispose
+
+ Undefines the given variable, then checks that the original ref was
+ destroyed.
+
+ my $x = [1,2,3];
+ dispose $x;
+ # $x is no longer defined.
+
+ This is primarily intended for cases where you no longer need a
+ variable, and want to ensure that you haven't accidentally captured a
+ strong reference to it elsewhere.
+
+ Note that this clears the caller's variable.
+
+ This function is defined with a prototype of ($), since it is only
+ intended for use on scalar variables. To clear multiple variables, use
+ a foreach loop:
+
+ my ($x, $y, $z) = ...;
+ dispose $_ for $x, $y, $z;
+ is($x, undef);
+ is($y, undef);
+ is($z, undef);
+
+ retain
+
+ Keeps a copy of this variable until program exit or "dispose".
+
+ Returns the original variable.
+
+ retain_future
+
+ Holds a copy of the given Future until it's marked ready, then releases
+ our copy. Does not use "dispose", since that could interfere with other
+ callbacks attached to the Future.
+
+ Since Future 0.36, this behaviour is directly available via the
+ "retain" in Future method, so it is recommended to use that instead of
+ this function.
+
+ Returns the original Future.
+
+SEE ALSO
+
+ * Devel::Refcount - assert_oneref is almost identical to this,
+ although it doesn't clear the variable it's called on
+
+ * Closure::Explicit - provides a sub{} wrapper that will complain if
+ you capture a lexical without explicitly declaring that you're going
+ to do that.
+
+AUTHOR
+
+ Tom Molesworth <cpan@perlsite.co.uk>
+
+LICENSE
+
+ Copyright Tom Molesworth 2014-2015. Licensed under the same terms as
+ Perl itself.
diff --git a/SIGNATURE b/SIGNATURE
deleted file mode 100644
index ec3db68..0000000
--- a/SIGNATURE
+++ /dev/null
@@ -1,50 +0,0 @@
-This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.73.
-
-To verify the content in this distribution, first make sure you have
-Module::Signature installed, then type:
-
- % cpansign -v
-
-It will check each file's integrity, as well as the signature's
-validity. If "==> Signature verified OK! <==" is not displayed,
-the distribution may already have been compromised, and you should
-not run its Makefile.PL or Build.PL.
-
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-SHA1 7445a489122f66de963a7484f676382ad08a915d Changes
-SHA1 a208cbdb5fc156a5564a59d8ca963bc058de387a INSTALL
-SHA1 6b50b30fa6f8d063d96e32c9a81f3f82328925f7 LICENSE
-SHA1 c90184c27fc3cd644268f853cad64a9a593906a1 MANIFEST
-SHA1 b8b30966a55bdc7196163dfb499c0c136851c573 META.json
-SHA1 881383469e96fdf9d15904354ddd4777ba1eb28f META.yml
-SHA1 721d11532d78982ee5981c4bd1ededb86bd90840 Makefile.PL
-SHA1 1c0b3d9c0f74e70fa2a9022934be815b3064bb26 README
-SHA1 fc2137b26983f5e33292da8fa380c46fdf2983ca cpanfile
-SHA1 a702916540e62702a72929de0b4e16bc6418e6a6 dist.ini
-SHA1 ecd01527275ee7896d31ce8f56d32f71601b281d lib/Variable/Disposition.pm
-SHA1 1cebbca4aef6bda130e545a4dba99c86343682d9 lib/Variable/Disposition.pod
-SHA1 985d9ded8d8ed7e344a09e52b1402e878e91da28 t/00-check-deps.t
-SHA1 77225336bf5068280a1f7252b84c3aa8c4199749 t/00-compile.t
-SHA1 549c15beab8d9f8a854cc47bd60a9c2b7dac2562 t/000-report-versions-tiny.t
-SHA1 5c940c8bc25f9a3388286d88e2e2f1062fc71d11 t/basic.t
-SHA1 c893d49f25a52a9b9cbe636b7079a33aa7da31e2 t/retain.t
-SHA1 069b1d6178f2e339e2854e7ec906dc7036d54d96 t/retain_future.t
-SHA1 198d1665317c3d91e3bb81f0a3b8dad8d4d66f20 xt/release/common_spelling.t
-SHA1 c6c3c9f7fe12058b4771449dff874b1c450c982c xt/release/mojibake.t
-SHA1 296928dbbcaffd1514ccc9b77a1e6e03cfe9b068 xt/release/pod-syntax.t
-SHA1 34513f89a70b96f6412fe2ef0ad4d475e8cac66c xt/release/synopsis.t
-SHA1 1294a6710ea8e2626e43722e50111bf872668316 xt/release/test-version.t
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1
-
-iQEcBAEBAgAGBQJU29USAAoJEFKElMNpjtyDIAcH+gK1vLutxm3ocFsoCCktbV/d
-FtG6Mkex8PZ0GQGHc0Idy6lectQ5j9B2Is+1Ke9sI0X0dnvF4eYy2d9wUipVhM30
-94X7blgGfY6QiOi6VYlxMm8rh65SJgybC+RviiioFDtD2KNhJrH6MR0kDLq5E26W
-KVTF9Cxs0vAdqqkzgq8O5hIuXLn6/6cHATS4t7QJ6FL/OEGTK8jnUDFHPV4YpPcP
-SxLTHwCN7tE39eLmHY0Jltzr4ebYrhYDpYM20T2SSZhcWEU/OmQUfQybk14iDzDf
-+I0d0MJpXJ7dAZmz2hdh6WHYvYGAfNLcrf1F1BTBjmGLvnsgQ6qzlB6PHJP9d2o=
-=n6dr
------END PGP SIGNATURE-----
diff --git a/cpanfile b/cpanfile
index 25d3590..5c2c4d1 100644
--- a/cpanfile
+++ b/cpanfile
@@ -1,4 +1,4 @@
-requires 'Future', '>= 0.30';
+requires 'Future', '>= 0.36';
on 'test' => sub {
requires 'Test::More', '>= 0.98';
diff --git a/dist.ini b/dist.ini
index abfc118..ba1b4e5 100644
--- a/dist.ini
+++ b/dist.ini
@@ -1,72 +1,8 @@
name = Variable-Disposition
-author = Tom Molesworth <cpan@perlsite.co.uk>
+author = Tom Molesworth <TEAM@cpan.org>
license = Perl_5
copyright_holder = Tom Molesworth
copyright_year = 2014
main_module = lib/Variable/Disposition.pm
-[Git::GatherDir]
-exclude_filename = Makefile.PL
-[PruneCruft]
-;[PruneFiles]
-[ManifestSkip]
-[MetaYAML]
-[License]
-[Readme]
-[MakeMaker]
-eumm_version = 6.48
-prereq_fatal = 1
-[ExecDir]
-[ShareDir]
-dir = share
-[Manifest]
-[TestRelease]
-[ConfirmRelease]
-[UploadToCPAN]
-[Prereqs::FromCPANfile]
-[Prereqs / BuildRequires]
-perl = 5.010001
-[CheckPrereqsIndexed]
-[CheckExtraTests]
-[NextRelease]
-[VersionFromModule]
-[PodVersion]
-[PkgVersion]
-[Homepage]
-[Bugtracker]
-; [PrePAN]
-; author = http://prepan.org/user/xyz
-; module = http://prepan.org/user/xyz
-[InstallGuide]
-[MetaJSON]
-[InsertExample]
-[PodInherit]
-[PodSyntaxTests]
-[MojibakeTests]
-[Test::CheckDeps]
-[Test::Compile]
-[Test::Synopsis]
-; [Test::EOL]
-[Test::Version]
-; [Test::Pod::LinkCheck]
-; [PodCoverageTests]
-; [Test::UnusedVars]
-[ReportVersions::Tiny]
-[SpellingCommonMistakesTests]
-[Signature]
-[CopyMakefilePLFromBuild]
-[ArchiveRelease]
-directory = /home/tom/dev/CPAN-Archive
-;[Git::Check]
-;allow_dirty = dist.ini
-;changelog = Changes
-[Git::Commit]
-allow_dirty = dist.ini
-allow_dirty = cpanfile
-allow_dirty = Changes
-allow_dirty = Makefile.PL
-[Git::Tag]
-tag_format = v%v
-tag_message = Tag v%v for CPAN release
-[ReversionOnRelease]
-
+[@Author::TEAM]
diff --git a/lib/Variable/Disposition.pm b/lib/Variable/Disposition.pm
index 98b2847..fea0ea6 100644
--- a/lib/Variable/Disposition.pm
+++ b/lib/Variable/Disposition.pm
@@ -5,16 +5,12 @@ use warnings;
use parent qw(Exporter);
-our $VERSION = '0.004';
+our $VERSION = '0.005';
=head1 NAME
Variable::Disposition - helper functions for disposing of variables
-=head1 VERSION
-
-version 0.004
-
=head1 SYNOPSIS
use feature qw(say);
@@ -55,8 +51,8 @@ added later.
our @EXPORT_OK = qw(dispose retain retain_future);
our %EXPORT_TAGS = (
- all => [ @EXPORT_OK ],
- v1 => [ qw(dispose retain retain_future) ],
+ all => [ @EXPORT_OK ],
+ v1 => [ qw(dispose retain retain_future) ],
);
our @EXPORT = qw(dispose);
@@ -94,12 +90,12 @@ on scalar variables. To clear multiple variables, use a L<foreach> loop:
=cut
sub dispose($) {
- die "Variable not defined" unless defined $_[0];
- die "Variable was not a ref" unless ref $_[0];
- delete $RETAINED{$_[0]}; # just in case we'd previously retained this one
- Scalar::Util::weaken(my $copy = $_[0]);
- undef $_[0];
- die "Variable was not released" if defined $copy;
+ die "Variable not defined" unless defined $_[0];
+ die "Variable was not a ref" unless ref $_[0];
+ delete $RETAINED{$_[0]}; # just in case we'd previously retained this one
+ Scalar::Util::weaken(my $copy = $_[0]);
+ undef $_[0];
+ die "Variable was not released" if defined $copy;
}
=head2 retain
@@ -111,10 +107,10 @@ Returns the original variable.
=cut
sub retain($) {
- die "Variable not defined" unless defined $_[0];
- die "Variable was not a ref" unless ref $_[0];
- $RETAINED{$_[0]} = $_[0];
- $_[0]
+ die "Variable not defined" unless defined $_[0];
+ die "Variable was not a ref" unless ref $_[0];
+ $RETAINED{$_[0]} = $_[0];
+ $_[0]
}
=head2 retain_future
@@ -123,14 +119,17 @@ Holds a copy of the given L<Future> until it's marked ready, then releases our c
Does not use L</dispose>, since that could interfere with other callbacks attached
to the L<Future>.
+Since Future 0.36, this behaviour is directly available via the L<Future/retain> method,
+so it is recommended to use that instead of this function.
+
Returns the original L<Future>.
=cut
sub retain_future {
- my ($f) = @_;
- die "Variable does not seem to be a Future, since it has no ->on_ready method" unless $f->can('on_ready');
- $f->on_ready(sub { undef $f });
+ my ($f) = @_;
+ die "Variable does not seem to be a Future, since it has no ->on_ready method" unless $f->can('on_ready');
+ return $f->retain;
}
1;
@@ -154,3 +153,4 @@ Tom Molesworth <cpan@perlsite.co.uk>
=head1 LICENSE
Copyright Tom Molesworth 2014-2015. Licensed under the same terms as Perl itself.
+
diff --git a/lib/Variable/Disposition.pod b/lib/Variable/Disposition.pod
index ab97eb0..630a2fb 100644
--- a/lib/Variable/Disposition.pod
+++ b/lib/Variable/Disposition.pod
@@ -1,3 +1,5 @@
+=encoding utf8
+
=for comment POD_DERIVED_INDEX_GENERATED
The following documentation is automatically generated. Please do not edit
this file, but rather the original, inline with Variable::Disposition
@@ -6,18 +8,12 @@ at lib/Variable/Disposition.pm
If you do edit this file, and don't want your changes to be removed, make
sure you change the first line.
-=encoding utf8
-
=cut
=head1 NAME
Variable::Disposition - helper functions for disposing of variables
-=head1 VERSION
-
-version 0.004
-
=head1 SYNOPSIS
use feature qw(say);
@@ -89,6 +85,9 @@ Holds a copy of the given L<Future> until it's marked ready, then releases our c
Does not use L</dispose>, since that could interfere with other callbacks attached
to the L<Future>.
+Since Future 0.36, this behaviour is directly available via the L<Future/retain> method,
+so it is recommended to use that instead of this function.
+
Returns the original L<Future>.
=head1 SEE ALSO
@@ -118,3 +117,4 @@ Tom Molesworth <cpan@perlsite.co.uk>
=head1 LICENSE
Copyright Tom Molesworth 2014-2015. Licensed under the same terms as Perl itself.
+
diff --git a/t/00-check-deps.t b/t/00-check-deps.t
index 175a3f1..e5e3679 100644
--- a/t/00-check-deps.t
+++ b/t/00-check-deps.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-# this test was generated with Dist::Zilla::Plugin::Test::CheckDeps 0.012
+# this test was generated with Dist::Zilla::Plugin::Test::CheckDeps 0.014
use Test::More 0.94;
use Test::CheckDeps 0.010;
diff --git a/t/00-compile.t b/t/00-compile.t
index f6155dc..c007359 100644
--- a/t/00-compile.t
+++ b/t/00-compile.t
@@ -2,7 +2,7 @@ use 5.006;
use strict;
use warnings;
-# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.051
+# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058
use Test::More;
@@ -16,7 +16,9 @@ my @module_files = (
# no fake home requested
-my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
+my @switches = (
+ -d 'blib' ? '-Mblib' : '-Ilib',
+);
use File::Spec;
use IPC::Open3;
@@ -30,12 +32,19 @@ for my $lib (@module_files)
# 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]");
+ diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
+ $^X, @switches, '-e', "require q[$lib]"))
+ if $ENV{PERL_COMPILE_TEST_DEBUG};
+
+ my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$lib loaded ok");
+ shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
+ and not eval { +require blib; blib->VERSION('1.01') };
+
if (@_warnings)
{
warn @_warnings;
diff --git a/t/00-report-prereqs.dd b/t/00-report-prereqs.dd
new file mode 100644
index 0000000..fbc3a37
--- /dev/null
+++ b/t/00-report-prereqs.dd
@@ -0,0 +1,46 @@
+do { my $x = {
+ 'configure' => {
+ 'requires' => {
+ 'ExtUtils::MakeMaker' => '0'
+ }
+ },
+ 'develop' => {
+ 'requires' => {
+ 'Dist::Zilla' => '5',
+ 'Dist::Zilla::PluginBundle::Author::TEAM' => '0',
+ 'Software::License::Perl_5' => '0',
+ 'Test::CPAN::Changes' => '0.19',
+ 'Test::CPAN::Meta' => '0',
+ 'Test::EOL' => '0',
+ 'Test::MinimumVersion' => '0',
+ 'Test::Mojibake' => '0',
+ 'Test::More' => '0.88',
+ 'Test::NoTabs' => '0',
+ 'Test::Pod' => '1.41',
+ 'Test::Portability::Files' => '0',
+ 'Test::Version' => '1'
+ }
+ },
+ 'runtime' => {
+ 'requires' => {
+ 'Future' => '0.36'
+ }
+ },
+ 'test' => {
+ 'recommends' => {
+ 'CPAN::Meta' => '2.120900'
+ },
+ 'requires' => {
+ 'ExtUtils::MakeMaker' => '0',
+ 'File::Spec' => '0',
+ 'IO::Handle' => '0',
+ 'IPC::Open3' => '0',
+ 'Test::CheckDeps' => '0.010',
+ 'Test::Fatal' => '0.010',
+ 'Test::More' => '0.98',
+ 'Test::Refcount' => '0'
+ }
+ }
+ };
+ $x;
+ } \ No newline at end of file
diff --git a/t/00-report-prereqs.t b/t/00-report-prereqs.t
new file mode 100644
index 0000000..5696476
--- /dev/null
+++ b/t/00-report-prereqs.t
@@ -0,0 +1,197 @@
+#!perl
+
+use strict;
+use warnings;
+
+# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.029
+
+use Test::More tests => 1;
+
+use ExtUtils::MakeMaker;
+use File::Spec;
+
+# from $version::LAX
+my $lax_version_re =
+ qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
+ |
+ (?:\.[0-9]+) (?:_[0-9]+)?
+ ) | (?:
+ v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
+ |
+ (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)?
+ )
+ )/x;
+
+# hide optional CPAN::Meta modules from prereq scanner
+# and check if they are available
+my $cpan_meta = "CPAN::Meta";
+my $cpan_meta_pre = "CPAN::Meta::Prereqs";
+my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic
+
+# Verify requirements?
+my $DO_VERIFY_PREREQS = 1;
+
+sub _max {
+ my $max = shift;
+ $max = ( $_ > $max ) ? $_ : $max for @_;
+ return $max;
+}
+
+sub _merge_prereqs {
+ my ($collector, $prereqs) = @_;
+
+ # CPAN::Meta::Prereqs object
+ if (ref $collector eq $cpan_meta_pre) {
+ return $collector->with_merged_prereqs(
+ CPAN::Meta::Prereqs->new( $prereqs )
+ );
+ }
+
+ # Raw hashrefs
+ for my $phase ( keys %$prereqs ) {
+ for my $type ( keys %{ $prereqs->{$phase} } ) {
+ for my $module ( keys %{ $prereqs->{$phase}{$type} } ) {
+ $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module};
+ }
+ }
+ }
+
+ return $collector;
+}
+
+my @include = qw(
+
+);
+
+my @exclude = qw(
+
+);
+
+# Add static prereqs to the included modules list
+my $static_prereqs = do './t/00-report-prereqs.dd';
+
+# Merge all prereqs (either with ::Prereqs or a hashref)
+my $full_prereqs = _merge_prereqs(
+ ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ),
+ $static_prereqs
+);
+
+# Add dynamic prereqs to the included modules list (if we can)
+my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
+my $cpan_meta_error;
+if ( $source && $HAS_CPAN_META
+ && (my $meta = eval { CPAN::Meta->load_file($source) } )
+) {
+ $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
+}
+else {
+ $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source)
+ $source = 'static metadata';
+}
+
+my @full_reports;
+my @dep_errors;
+my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
+
+# Add static includes into a fake section
+for my $mod (@include) {
+ $req_hash->{other}{modules}{$mod} = 0;
+}
+
+for my $phase ( qw(configure build test runtime develop other) ) {
+ next unless $req_hash->{$phase};
+ next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING});
+
+ for my $type ( qw(requires recommends suggests conflicts modules) ) {
+ next unless $req_hash->{$phase}{$type};
+
+ my $title = ucfirst($phase).' '.ucfirst($type);
+ my @reports = [qw/Module Want Have/];
+
+ for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) {
+ next if grep { $_ eq $mod } @exclude;
+
+ my $want = $req_hash->{$phase}{$type}{$mod};
+ $want = "undef" unless defined $want;
+ $want = "any" if !$want && $want == 0;
+
+ if ($mod eq 'perl') {
+ push @reports, ['perl', $want, $]];
+ next;
+ }
+
+ my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required";
+
+ my $file = $mod;
+ $file =~ s{::}{/}g;
+ $file .= ".pm";
+ my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;
+
+ if ($prefix) {
+ my $have = MM->parse_version( File::Spec->catfile($prefix, $file) );
+ $have = "undef" unless defined $have;
+ push @reports, [$mod, $want, $have];
+
+ if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
+ if ( $have !~ /\A$lax_version_re\z/ ) {
+ push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";
+ }
+ elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) {
+ push @dep_errors, "$mod version '$have' is not in required range '$want'";
+ }
+ }
+ }
+ else {
+ push @reports, [$mod, $want, "missing"];
+
+ if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) {
+ push @dep_errors, "$mod is not installed ($req_string)";
+ }
+ }
+ }
+
+ if ( @reports ) {
+ push @full_reports, "=== $title ===\n\n";
+
+ my $ml = _max( map { length $_->[0] } @reports );
+ my $wl = _max( map { length $_->[1] } @reports );
+ my $hl = _max( map { length $_->[2] } @reports );
+
+ if ($type eq 'modules') {
+ splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
+ push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
+ }
+ else {
+ splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
+ push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
+ }
+
+ push @full_reports, "\n";
+ }
+ }
+}
+
+if ( @full_reports ) {
+ diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports;
+}
+
+if ( $cpan_meta_error || @dep_errors ) {
+ diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n";
+}
+
+if ( $cpan_meta_error ) {
+ my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
+ diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n";
+}
+
+if ( @dep_errors ) {
+ diag join("\n",
+ "\nThe following REQUIRED prerequisites were not satisfied:\n",
+ @dep_errors,
+ "\n"
+ );
+}
+
+pass('Reported prereqs');
+
+# vim: ts=4 sts=4 sw=4 et:
diff --git a/t/000-report-versions-tiny.t b/t/000-report-versions-tiny.t
deleted file mode 100644
index 721419e..0000000
--- a/t/000-report-versions-tiny.t
+++ /dev/null
@@ -1,78 +0,0 @@
-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 = '5.010001';
- $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.48') };
-eval { $v .= pmver('File::Spec','any version') };
-eval { $v .= pmver('Future','0.30') };
-eval { $v .= pmver('IO::Handle','any version') };
-eval { $v .= pmver('IPC::Open3','any version') };
-eval { $v .= pmver('Test::CheckDeps','0.010') };
-eval { $v .= pmver('Test::Fatal','0.010') };
-eval { $v .= pmver('Test::More','0.98') };
-eval { $v .= pmver('Test::Refcount','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;
diff --git a/t/basic.t b/t/basic.t
index 42c0310..0fe5c13 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -6,47 +6,47 @@ use Test::Fatal;
use Variable::Disposition;
{
- my $x = [1,2,3];
- isa_ok($x, 'ARRAY');
- dispose $x;
- is($x, undef, 'was undefined correctly');
+ my $x = [1,2,3];
+ isa_ok($x, 'ARRAY');
+ dispose $x;
+ is($x, undef, 'was undefined correctly');
}
{
- my $x = [1,2,3];
- my $copy = $x;
- like(exception {
- dispose $x;
- }, qr/not released/, 'raise an exception if variable is still around');
- is($x, undef, 'was still undefined correctly');
- is(exception {
- dispose $copy;
- }, undef, 'no exception when last copy goes');
+ my $x = [1,2,3];
+ my $copy = $x;
+ like(exception {
+ dispose $x;
+ }, qr/not released/, 'raise an exception if variable is still around');
+ is($x, undef, 'was still undefined correctly');
+ is(exception {
+ dispose $copy;
+ }, undef, 'no exception when last copy goes');
}
{
- my $x = 'test';
- like(exception {
- dispose $x;
- }, qr/not a ref/, 'raise an exception when called on non-ref');
- is($x, 'test', 'still defined');
- undef $x;
- like(exception {
- dispose $x;
- }, qr/not defined/, 'raise an exception when called on undef');
+ my $x = 'test';
+ like(exception {
+ dispose $x;
+ }, qr/not a ref/, 'raise an exception when called on non-ref');
+ is($x, 'test', 'still defined');
+ undef $x;
+ like(exception {
+ dispose $x;
+ }, qr/not defined/, 'raise an exception when called on undef');
}
my $destroyed = 0;
{
- {
- package Local::Test;
- sub DESTROY { ++$destroyed }
- }
- my $x = bless {}, 'Local::Test';
- is($destroyed, 0, 'not yet destroyed');
- dispose $x;
- is($destroyed, 1, 'destroyed after dispose()');
- is($x, undef, 'was undef');
+ {
+ package Local::Test;
+ sub DESTROY { ++$destroyed }
+ }
+ my $x = bless {}, 'Local::Test';
+ is($destroyed, 0, 'not yet destroyed');
+ dispose $x;
+ is($destroyed, 1, 'destroyed after dispose()');
+ is($x, undef, 'was undef');
}
is($destroyed, 1, 'still only a single DESTROY called when leaving scope');
diff --git a/t/retain.t b/t/retain.t
index 9e74ac5..03f90d1 100644
--- a/t/retain.t
+++ b/t/retain.t
@@ -7,14 +7,14 @@ use Variable::Disposition qw(retain dispose);
my $copy;
{
- my $x = [];
- Scalar::Util::weaken($copy = $x);
- ok($x, 'have a variable');
- is_refcount($x, 1, 'refcount is now 1');
- Scalar::Util::weaken($copy = $x);
- is_refcount($x, 1, 'refcount is still 1');
- retain($x);
- is_refcount($x, 2, 'refcount is now 2');
+ my $x = [];
+ Scalar::Util::weaken($copy = $x);
+ ok($x, 'have a variable');
+ is_refcount($x, 1, 'refcount is now 1');
+ Scalar::Util::weaken($copy = $x);
+ is_refcount($x, 1, 'refcount is still 1');
+ retain($x);
+ is_refcount($x, 2, 'refcount is now 2');
}
is_refcount($copy, 1, 'refcount is still 1');
ok($copy, 'copy still exists');
diff --git a/t/retain_future.t b/t/retain_future.t
index 022c972..f30d8b0 100644
--- a/t/retain_future.t
+++ b/t/retain_future.t
@@ -6,24 +6,24 @@ use Test::Refcount;
use Variable::Disposition qw(retain_future dispose);
unless(eval { require Future }) {
- plan skip_all => 'this test requires Future.pm';
+ plan skip_all => 'this test requires Future.pm';
}
for my $resolution (qw(done fail cancel)) {
- my $f = Future->new;
- is_refcount($f, 1, 'refcount is 1');
- retain_future($f);
- is_refcount($f, 2, 'refcount is now 2');
- $f->$resolution('...');
- is_refcount($f, 1, 'refcount is back to 1 after ' . $resolution);
- dispose($f);
- is($f, undef, 'goes away after dispose');
+ my $f = Future->new;
+ is_refcount($f, 1, 'refcount is 1');
+ retain_future($f);
+ is_refcount($f, 2, 'refcount is now 2');
+ $f->$resolution($resolution eq 'cancel' ? () : '...');
+ is_refcount($f, 1, 'refcount is back to 1 after ' . $resolution);
+ dispose($f);
+ is($f, undef, 'goes away after dispose');
}
{
- ok(retain_future(Future->done), 'can retain ->done Future');
- ok(retain_future(Future->fail("...")), 'can retain ->failed Future');
- ok(retain_future(Future->new->cancel), 'can retain ->cancelled Future');
+ ok(retain_future(Future->done), 'can retain ->done Future');
+ ok(retain_future(Future->fail("...")), 'can retain ->failed Future');
+ ok(retain_future(Future->new->cancel), 'can retain ->cancelled Future');
}
diff --git a/xt/author/distmeta.t b/xt/author/distmeta.t
new file mode 100644
index 0000000..d13978a
--- /dev/null
+++ b/xt/author/distmeta.t
@@ -0,0 +1,7 @@
+#!perl
+# This file was automatically generated by Dist::Zilla::Plugin::MetaTests.
+use strict;
+use warnings;
+use Test::CPAN::Meta;
+
+meta_yaml_ok();
diff --git a/xt/author/eol.t b/xt/author/eol.t
new file mode 100644
index 0000000..e264303
--- /dev/null
+++ b/xt/author/eol.t
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19
+
+use Test::More 0.88;
+use Test::EOL;
+
+my @files = (
+ 'lib/Variable/Disposition.pm',
+ 'lib/Variable/Disposition.pod',
+ 't/00-check-deps.t',
+ 't/00-compile.t',
+ 't/00-report-prereqs.dd',
+ 't/00-report-prereqs.t',
+ 't/basic.t',
+ 't/retain.t',
+ 't/retain_future.t',
+ 'xt/author/distmeta.t',
+ 'xt/author/eol.t',
+ 'xt/author/minimum-version.t',
+ 'xt/author/mojibake.t',
+ 'xt/author/no-tabs.t',
+ 'xt/author/pod-syntax.t',
+ 'xt/author/portability.t',
+ 'xt/author/test-version.t',
+ 'xt/release/common_spelling.t',
+ 'xt/release/cpan-changes.t'
+);
+
+eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
+done_testing;
diff --git a/xt/author/minimum-version.t b/xt/author/minimum-version.t
new file mode 100644
index 0000000..1e5e5b4
--- /dev/null
+++ b/xt/author/minimum-version.t
@@ -0,0 +1,6 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::MinimumVersion;
+all_minimum_version_ok( qq{5.14.0} );
diff --git a/xt/author/mojibake.t b/xt/author/mojibake.t
new file mode 100644
index 0000000..5ef161e
--- /dev/null
+++ b/xt/author/mojibake.t
@@ -0,0 +1,9 @@
+#!perl
+
+use strict;
+use warnings qw(all);
+
+use Test::More;
+use Test::Mojibake;
+
+all_files_encoding_ok();
diff --git a/xt/author/no-tabs.t b/xt/author/no-tabs.t
new file mode 100644
index 0000000..978914a
--- /dev/null
+++ b/xt/author/no-tabs.t
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15
+
+use Test::More 0.88;
+use Test::NoTabs;
+
+my @files = (
+ 'lib/Variable/Disposition.pm',
+ 'lib/Variable/Disposition.pod',
+ 't/00-check-deps.t',
+ 't/00-compile.t',
+ 't/00-report-prereqs.dd',
+ 't/00-report-prereqs.t',
+ 't/basic.t',
+ 't/retain.t',
+ 't/retain_future.t',
+ 'xt/author/distmeta.t',
+ 'xt/author/eol.t',
+ 'xt/author/minimum-version.t',
+ 'xt/author/mojibake.t',
+ 'xt/author/no-tabs.t',
+ 'xt/author/pod-syntax.t',
+ 'xt/author/portability.t',
+ 'xt/author/test-version.t',
+ 'xt/release/common_spelling.t',
+ 'xt/release/cpan-changes.t'
+);
+
+notabs_ok($_) foreach @files;
+done_testing;
diff --git a/xt/release/pod-syntax.t b/xt/author/pod-syntax.t
index f0468f1..e563e5d 100644
--- a/xt/release/pod-syntax.t
+++ b/xt/author/pod-syntax.t
@@ -1,5 +1,6 @@
#!perl
# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
+use strict; use warnings;
use Test::More;
use Test::Pod 1.41;
diff --git a/xt/author/portability.t b/xt/author/portability.t
new file mode 100644
index 0000000..6d1d92d
--- /dev/null
+++ b/xt/author/portability.t
@@ -0,0 +1,8 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+use Test::Portability::Files;
+
+run_tests();
diff --git a/xt/release/test-version.t b/xt/author/test-version.t
index 9bccdf0..247ba9a 100644
--- a/xt/release/test-version.t
+++ b/xt/author/test-version.t
@@ -2,20 +2,21 @@ use strict;
use warnings;
use Test::More;
-# generated by Dist::Zilla::Plugin::Test::Version 0.003001
+# generated by Dist::Zilla::Plugin::Test::Version 1.09
use Test::Version;
-my @imports = ( 'version_all_ok' );
+my @imports = qw( version_all_ok );
my $params = {
- is_strict => 0,
- has_version => 1,
+ is_strict => 0,
+ has_version => 1,
+ multiple => 0,
+
};
push @imports, $params
if version->parse( $Test::Version::VERSION ) >= version->parse('1.002');
-
Test::Version->import(@imports);
version_all_ok;
diff --git a/xt/release/cpan-changes.t b/xt/release/cpan-changes.t
new file mode 100644
index 0000000..286005a
--- /dev/null
+++ b/xt/release/cpan-changes.t
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+
+# this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012
+
+use Test::More 0.96 tests => 1;
+use Test::CPAN::Changes;
+subtest 'changes_ok' => sub {
+ changes_file_ok('Changes');
+};
diff --git a/xt/release/mojibake.t b/xt/release/mojibake.t
deleted file mode 100644
index 390c632..0000000
--- a/xt/release/mojibake.t
+++ /dev/null
@@ -1,12 +0,0 @@
-#!perl
-
-use strict;
-use warnings qw(all);
-
-use Test::More;
-
-## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval)
-eval q(use Test::Mojibake);
-plan skip_all => q(Test::Mojibake required for source encoding testing) if $@;
-
-all_files_encoding_ok();
diff --git a/xt/release/synopsis.t b/xt/release/synopsis.t
deleted file mode 100644
index 3e03427..0000000
--- a/xt/release/synopsis.t
+++ /dev/null
@@ -1,5 +0,0 @@
-#!perl
-
-use Test::Synopsis;
-
-all_synopsis_ok();