use Moose qw(confess);
use Sub::Exporter ();
use Sub::Name ();
-use Reaction::Types::Core;
+use Reaction::Types::Core ':all';
use Reaction::Object;
sub exporter_for_package {
}
if (@supers) {
Class::MOP::load_class($_) for @supers;
- $class->meta->_fix_metaclass_incompatability(@supers);
$class->meta->superclasses(@supers);
}
$self->setup_and_cleanup($package, $setup);
shift if $_[0] eq 'as';
push(@methods, [ $name, shift ]);
};
+ my $s = $setup;
foreach my $meth ($self->delayed_methods) {
$save_delayed{$meth} = $package->can($meth);
- local *{"${package}::${meth}"} =
- Sub::Name::subname "${self}::${meth}" => sub {
- push(@apply_after, [ $meth => @_ ]);
- };
+ my $s_copy = $s;
+ $s = sub {
+ local *{"${package}::${meth}"} =
+ Sub::Name::subname "${self}::${meth}" => sub {
+ push(@apply_after, [ $meth => @_ ]);
+ };
+ $s_copy->(@_);
+ };
}
# XXX - need additional fuckery to handle multi-class-per-file
- $setup->(); # populate up the crap
+ $s->(); # populate up the crap
}
my %exports = $self->exports_for_package($package);
{
eval "package ${package}; no $unimport_class;";
confess "$unimport_class unimport from ${package} failed: $@" if $@;
foreach my $m (@methods) {
- $package->meta->add_method(@$m);
+ $self->add_method_to_target($package, $m);
}
foreach my $a (@apply_after) {
my $call = shift(@$a);
}
}
+sub add_method_to_target {
+ my ($self, $target, $method) = @_;
+ $target->meta->add_method(@$method);
+}
+
sub delayed_methods {
return (qw/has with extends before after around override augment/);
}
=item * Andres N. Kievsky (Documentation)
+=item * Robert Sedlacek (Documentation)
+
+=back
+
+=head1 SPONSORS
+
+=over
+
+=item * Ionzero
+
+L<Ionzero|http://www.ionzero.com/> sponsored the writing of the
+L<Reaction::Manual::Tutorial>, L<Reaction::Manual::Overview> and
+L<Reaction::Manual::Widgets> documentations as well as improvements
+to L<Reaction::Manual::Intro> and many API documentation improvements
+throughout the project.
+
=back
=head1 LICENSE