Initial import (perl-Sub-Exporter-Progressive-0.001006-1)

Sub::Exporter is an incredibly powerful module, but with that power comes
great responsibility, er- as well as some runtime penalties. This module is a
Sub::Exporter wrapper that will let your users just use Exporter if all they
are doing is picking exports, but use Sub::Exporter if your users try to use
Sub::Exporter's more advanced features features, like renaming exports, if
they try to use them.

Note that this module will export @EXPORT and @EXPORT_OK package variables for
Exporter to work. Additionally, if your package uses advanced Sub::Exporter
features like currying, this module will only ever use Sub::Exporter, so you
might as well use it directly.
This commit is contained in:
Paul Howarth 2012-08-28 08:57:43 +01:00
parent 4718a33388
commit 12e02c51fe
4 changed files with 195 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/Sub-Exporter-Progressive-[0-9.]*.tar.gz

View File

@ -0,0 +1,94 @@
--- Makefile.PL
+++ Makefile.PL
@@ -10,6 +10,6 @@ WriteMakefile(
NAME => 'Sub-Exporter-Progressive',
VERSION_FROM => 'lib/Sub/Exporter/Progressive.pm',
$key => {
- 'Test::More' => 0.89,
+ 'Test::More' => 0.47,
}
);
--- t/all.t
+++ t/all.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More 0.89;
+use Test::More tests => 6;
use List::Util 'first';
use lib 't/lib';
use A::JunkAll;
@@ -10,5 +10,3 @@ use A::JunkAll;
ok(main->can('junk1'), 'sub exported');
ok(main->can('junk2'), 'sub exported');
ok(! $INC{'Sub/Exporter.pm'}, 'Sub::Exporter not loaded');
-
-done_testing;
--- t/basic.t
+++ t/basic.t
@@ -2,12 +2,10 @@
use strict;
use warnings;
-use Test::More 0.89;
+use Test::More tests => 2;
use List::Util 'first';
use lib 't/lib';
use A::Junk 'junk1';
ok(main->can('junk1'), 'requested sub exported');
ok(! $INC{'Sub/Exporter.pm'}, 'Sub::Exporter not loaded');
-
-done_testing;
--- t/default.t
+++ t/default.t
@@ -2,12 +2,10 @@
use strict;
use warnings;
-use Test::More 0.89;
+use Test::More tests => 2;
use List::Util 'first';
use lib 't/lib';
use A::Junk;
ok(main->can('junk2'), 'sub exported');
ok(! $INC{'Sub/Exporter.pm'}, 'Sub::Exporter not loaded');
-
-done_testing;
--- t/sex.t
+++ t/sex.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More 0.89;
+use Test::More tests => 2;
BEGIN {
plan skip_all => 'Sub::Exporter not installed'
unless eval { require Sub::Exporter };
@@ -14,5 +14,3 @@ use A::Junk 'junk1' => { -as => 'junk' }
ok(main->can('junk'), 'sub renamed with Sub::Exporter');
ok($INC{'Sub/Exporter.pm'}, 'Sub::Exporter loaded');
-
-done_testing;
--- t/tags.t
+++ t/tags.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
-use Test::More 0.89;
+use Test::More tests => 4;
use List::Util 'first';
use lib 't/lib';
use A::Junk ':other';
@@ -10,6 +10,3 @@ ok(!main->can('junk1'), 'junk1 not expor
ok(!main->can('junk2'), 'junk2 not exported');
ok(main->can('junk3'), 'junk3 exported');
ok(! $INC{'Sub/Exporter.pm'}, 'Sub::Exporter not loaded');
-
-done_testing;
-

View File

@ -0,0 +1,99 @@
# We need to patch the test suite if we have old versions of Test::More
%global old_test_more %(perl -MTest::More -e 'print (($Test::More::VERSION < 0.88) ? 1 : 0);' 2>/dev/null || echo 0)
Name: perl-Sub-Exporter-Progressive
Version: 0.001006
Release: 1%{?dist}
Summary: Only use Sub::Exporter if you need it
Group: Development/Libraries
License: GPL+ or Artistic
URL: http://search.cpan.org/dist/Sub-Exporter-Progressive/
Source0: http://search.cpan.org/CPAN/authors/id/L/LE/LEONT/Sub-Exporter-Progressive-%{version}.tar.gz
Patch1: Sub-Exporter-Progressive-0.001006-old-Test::More.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildArch: noarch
# =============== Module Build ======================
BuildRequires: perl(ExtUtils::MakeMaker)
# =============== Module Runtime ====================
BuildRequires: perl(Exporter)
BuildRequires: perl(List::Util)
BuildRequires: perl(Sub::Exporter)
# =============== Test Suite ========================
BuildRequires: perl(lib)
BuildRequires: perl(Test::More)
# =============== Module Runtime ====================
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
Requires: perl(Exporter)
Requires: perl(Sub::Exporter)
%description
Sub::Exporter is an incredibly powerful module, but with that power comes
great responsibility, er- as well as some runtime penalties. This module is a
Sub::Exporter wrapper that will let your users just use Exporter if all they
are doing is picking exports, but use Sub::Exporter if your users try to use
Sub::Exporter's more advanced features features, like renaming exports, if
they try to use them.
Note that this module will export @EXPORT and @EXPORT_OK package variables for
Exporter to work. Additionally, if your package uses advanced Sub::Exporter
features like currying, this module will only ever use Sub::Exporter, so you
might as well use it directly.
%prep
%setup -q -n Sub-Exporter-Progressive-%{version}
# We need to patch the test suite if we have old versions of Test::More
%if %{old_test_more}
%patch1
%endif
%build
perl Makefile.PL INSTALLDIRS=vendor
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} \;
%{_fixperms} %{buildroot}
%check
make test
%clean
rm -rf %{buildroot}
%files
%doc Changes README
%{perl_vendorlib}/Sub/
%{_mandir}/man3/Sub::Exporter::Progressive.3pm*
%changelog
* Mon Aug 27 2012 Paul Howarth <paul@city-fan.org> - 0.001006-1
- Update to 0.001006
- Handle ':all' correctly
- Update old Test::More patch
- Drop redundant buildreq perl(Test::Pod)
* Sat Aug 25 2012 Paul Howarth <paul@city-fan.org> - 0.001005-1
- Update to 0.001005
- Add support for tags
- Warn if defaults are not in exports
- Add explicit dependency on Test::More 0.89
- This release by LEONT -> update source URL
- Update old Test::More patch
* Thu Aug 9 2012 Paul Howarth <paul@city-fan.org> - 0.001004-1
- Update to 0.001004 (fix skipping when Sub::Exporter isn't installed)
- This release by MSTROUT -> update source URL
- No LICENSE file in this release
- Update old Test::More patch
* Wed Aug 1 2012 Paul Howarth <paul@city-fan.org> - 0.001003-1
- Update to 0.001003 (remove warning if there are no defaults)
* Wed Aug 1 2012 Paul Howarth <paul@city-fan.org> - 0.001002-2
- Sanitize for Fedora submission
* Wed Aug 1 2012 Paul Howarth <paul@city-fan.org> - 0.001002-1
- Initial RPM build

View File

@ -0,0 +1 @@
381704c10802bbbf13e8e99d7ddccfbe Sub-Exporter-Progressive-0.001006.tar.gz