Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Sub-Exporter-Progressive CPAN distribution.

Report information
The Basics
Id: 82419
Status: resolved
Priority: 0/
Queue: Sub-Exporter-Progressive

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: 0.001007



Subject: "use My::Utils -all" shouldn't trigger Sub::Exporter
It ought to be possible to rewrite: use My::Utils -all; so that Exporter.pm can handle it. I'm not advocating reimplementing half of Sub::Exporter within Sub::Exporter::Progressive, but a single, hyphen- prefixed tag should be doable.
On Sat Jan 05 01:38:31 2013, TOBYINK wrote: Show quoted text
> It ought to be possible to rewrite: > > use My::Utils -all; > > so that Exporter.pm can handle it. I'm not advocating reimplementing half > of Sub::Exporter within Sub::Exporter::Progressive, but a single, hyphen- > prefixed tag should be doable.
Looks to me like it can be fixed in two lines of code (":tag" is already handled, so it's jut a matter of substitution). Could you write some tests for this? Leon
Subject: progressive-tags-without-sub-exporter.t
use strict; use warnings; use Test::More; use Test::Without::Module 'Sub::Exporter'; BEGIN { package Local::Exporter; use Sub::Exporter::Progressive -setup => { exports => [qw/ foo bar baz /], groups => { default => [qw/ foo /], bb => [qw/ bar baz /], }, }; use constant { foo => 1, bar => 2, baz => 3, }; $INC{'Local/Exporter.pm'} = __FILE__; }; my $i = 0; sub check_tag { my ($tag, $should, $shouldnt) = @_; my $pkg = 'Local::Importer' . ++$i; subtest "test the '$tag' tag" => sub { plan tests => 1 + @$should + @$shouldnt; local $@ = undef; ok(eval qq{ package $pkg; use Local::Exporter qw( $tag ); 1; }, "$pkg compiled") or diag $@; ok( $pkg->can($_), "$pkg\->can(\"$_\")") for @$should; ok(!$pkg->can($_), "$pkg\->can't(\"$_\")") for @$shouldnt; } } check_tag(':default', [qw/foo/], [qw/bar baz/]); check_tag('-default', [qw/foo/], [qw/bar baz/]); check_tag(':default bar', [qw/foo bar/], [qw/baz/]); check_tag('-default bar', [qw/foo bar/], [qw/baz/]); check_tag('bar :default', [qw/foo bar/], [qw/baz/]); check_tag('bar -default', [qw/foo bar/], [qw/baz/]); check_tag(':bb', [qw/bar baz/], [qw/foo/]); check_tag('-bb', [qw/bar baz/], [qw/foo/]); check_tag(':all', [qw/foo bar baz/], []); check_tag('-all', [qw/foo bar baz/], []); done_testing();
Didn't this get fixed by 0.001008 as well?
On Tue Jan 22 10:35:18 2013, RIBASUSHI wrote: Show quoted text
> Didn't this get fixed by 0.001008 as well?
By 0.001007 actually. Marked as resolved now. Leon