Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 43812
Status: rejected
Priority: 0/
Queue: Sub-Exporter

People
Owner: Nobody in particular
Requestors: hynek [...] gooddata.com
Cc:
AdminCc:

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



Subject: BUG: Collectors are not exported
Date: Tue, 3 Mar 2009 17:51:56 +0100
To: bug-Sub-Exporter [...] rt.cpan.org
From: Hynek Vychodil <hynek [...] gooddata.com>
Hello, It seems as bug for me. I have simplified example in Sub::Exporter::Cookbook ( http://search.cpan.org/~rjbs/Sub-Exporter-0.982/lib/Sub/Exporter/Cookbook.pod ) altering importers @ISA to minimize test case: --- subexpdemo.pm --- package subexpdemo; use Sub::Exporter -setup => { collectors => { _become_plugin => \'_become_plugin' }, groups => [ plugin => ['_become_plugin'] ] }; sub _become_plugin { my ( $class, $value, $data ) = @_; my $target = $data->{into}; push @{"$target\::ISA"}, $class->plugin_base_class; } 1; --- subexpdemo.pm --- and my test script --- subexpdemo.pl --- use strict; use warnings; package Foo::Bar; use subexpdemo '-plugin'; --- subexpdemo.pl --- It throws. "_become_plugin" is not exported by the subexpdemo module at log_test.pl line 6 BEGIN failed--compilation aborted at subexpdemo.pl line 6. I'm interested in it because I want generate function using 'into' value ( http://stackoverflow.com/questions/595662/how-can-i-easily-generate-a-function-depending-on-name-of-class-to-export-to ). Even of this bug it seems not be solution for me. I can't protect to forgot add '_become_plugin' like collector or group containing it include in import parameters. I have peeped in source code and it seem that it will be easy add `into` value to generator parameters. I hope that can provide patch if I will not be too much busy. Best regards -- --Hynek (Pichi) Vychodil Analyze your data in minutes. Share your insights instantly. Thrill your boss. Be a data hero! Try Good Data now for free: www.gooddata.com
This is not a bug. Groups may only contain other groups or exports. What you should do, instead, is create a collector called "-plugin" that uses the _become_plugin callback and puts "-_actual_group" into import_args. -- rjbs
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #43812] BUG: Collectors are not exported
Date: Tue, 3 Mar 2009 12:10:48 -0500
To: Hynek Vychodil via RT <bug-Sub-Exporter [...] rt.cpan.org>
From: Ricardo SIGNES <rjbs [...] cpan.org>
* Hynek Vychodil via RT <bug-Sub-Exporter@rt.cpan.org> [2009-03-03T11:52:56] Show quoted text
> It seems as bug for me. > > I have simplified example in Sub::Exporter::Cookbook ( > http://search.cpan.org/~rjbs/Sub-Exporter-0.982/lib/Sub/Exporter/Cookbook.pod > ) altering importers @ISA to minimize test case:
I have updated the documentation: http://github.com/rjbs/sub-exporter/commit/4178ae89a3dac22441b94ab2b9f351d1a85e6323 -- rjbs
Subject: Re: [rt.cpan.org #43812] BUG: Collectors are not exported
Date: Tue, 3 Mar 2009 18:29:25 +0100
To: bug-Sub-Exporter [...] rt.cpan.org
From: Hynek Vychodil <hynek [...] gooddata.com>
Thanks for answer. If I understand it correctly, it works in opposite way now (in documentation example). I should import "collector" and it forces group import. May be Cookbook should be more verbose in this point. It is not obvious. Unfortunately, it is not solving my problem anyway but nice to know this trick. Thanks Hynek On Tue, Mar 3, 2009 at 6:08 PM, Ricardo SIGNES via RT < bug-Sub-Exporter@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=43812 > > > This is not a bug. > > Groups may only contain other groups or exports. > > What you should do, instead, is create a collector called "-plugin" that > uses the _become_plugin callback and puts "-_actual_group" into > import_args. > > -- > rjbs >
-- --Hynek (Pichi) Vychodil Analyze your data in minutes. Share your insights instantly. Thrill your boss. Be a data hero! Try Good Data now for free: www.gooddata.com