diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-06-27 17:41:33 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-06-27 17:41:33 -0400 |
commit | 436bede5fac60885a053baadf5dd659b258997b0 (patch) | |
tree | a6c77589f2be1ffb2dc5e50adb570d6ffd763fe3 /lib/Reply/Plugin/Packages.pm | |
parent | fc6ae897dfa5861b9b2eaf069ab38389630adf90 (diff) | |
download | reply-436bede5fac60885a053baadf5dd659b258997b0.tar.gz reply-436bede5fac60885a053baadf5dd659b258997b0.zip |
make the current package go through the publisher too
Diffstat (limited to 'lib/Reply/Plugin/Packages.pm')
-rw-r--r-- | lib/Reply/Plugin/Packages.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Reply/Plugin/Packages.pm b/lib/Reply/Plugin/Packages.pm index d6fad68..054467a 100644 --- a/lib/Reply/Plugin/Packages.pm +++ b/lib/Reply/Plugin/Packages.pm @@ -26,6 +26,9 @@ sub new { my $self = $class->SUPER::new(@_); $self->{package} = $opts{default_package} || 'main'; + $self->{publisher} = $opts{publisher}; + + $self->{publisher}->(package => $self->{package}); return $self; } @@ -48,14 +51,13 @@ sub compile { my $self = shift; my ($next, $line, %args) = @_; - $args{package} = $self->{package}; - my @result = $next->($line, %args); # XXX it'd be nice to avoid using globals here, but we can't use # eval_closure's environment parameter since we need to access the # information in a BEGIN block $self->{package} = our $package; + $self->{publisher}->(package => $self->{package}); return @result; } |