[Bast-commits] r3637 - in trunk/Class-C3-Componentised: .
lib/Class/C3 t/lib t/lib/MyModule/Plugin
ash at dev.catalyst.perl.org
ash at dev.catalyst.perl.org
Mon Jul 30 20:23:46 GMT 2007
Author: ash
Date: 2007-07-30 20:23:38 +0100 (Mon, 30 Jul 2007)
New Revision: 3637
Removed:
trunk/Class-C3-Componentised/META.yml
Modified:
trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm
trunk/Class-C3-Componentised/t/lib/MyModule.pm
trunk/Class-C3-Componentised/t/lib/MyModule/Plugin/Foo.pm
Log:
Fix up pod. I was being mad.
Deleted: trunk/Class-C3-Componentised/META.yml
===================================================================
--- trunk/Class-C3-Componentised/META.yml 2007-07-30 13:44:14 UTC (rev 3636)
+++ trunk/Class-C3-Componentised/META.yml 2007-07-30 19:23:38 UTC (rev 3637)
@@ -1,16 +0,0 @@
----
-name: Class-C3-Componentised
-version: 0.01
-author:
- - 'Matt S. Trout <mst at shadowcatsystems.co.uk>'
-abstract: ~
-license: perl
-requires:
- Class::C3: 0
-build_requires:
- Test::More: 0
-provides:
- Class::C3::Componentised:
- file: lib/Class/C3/Componentised.pm
- version: 0.01
-generated_by: Module::Build version 0.26
Modified: trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm
===================================================================
--- trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm 2007-07-30 13:44:14 UTC (rev 3636)
+++ trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm 2007-07-30 19:23:38 UTC (rev 3637)
@@ -17,12 +17,22 @@
use base 'Class::C3::Componentised';
- sub component_base_class { "MyModule::Plugin" }
+ sub component_base_class { "MyModule::Component" }
package main;
- MyModule->load_components( $self->{plugins} );
+ MyModule->load_components( qw/Foo Bar/ );
+ # Will load MyModule::Component::Foo an MyModule::Component::Bar
+=head1 DESCRIPTION
+
+This will inject base classes to your module using the L<Class::C3> method
+resolution order.
+
+Please note: these are not plugins that can take precedence over methods
+declared in MyModule. If you want something like that, consider
+L<MooseX::Object::Pluggable>.
+
=head1 METHODS
=cut
@@ -158,7 +168,7 @@
{
no strict 'refs';
foreach my $to (reverse @to_inject) {
- unshift( @{"${target}::ISA"}, $to )
+ unshift ( @{"${target}::ISA"}, $to )
unless ($target eq $to || $target->isa($to));
}
}
Modified: trunk/Class-C3-Componentised/t/lib/MyModule/Plugin/Foo.pm
===================================================================
--- trunk/Class-C3-Componentised/t/lib/MyModule/Plugin/Foo.pm 2007-07-30 13:44:14 UTC (rev 3636)
+++ trunk/Class-C3-Componentised/t/lib/MyModule/Plugin/Foo.pm 2007-07-30 19:23:38 UTC (rev 3637)
@@ -4,8 +4,7 @@
use Class::C3;
sub message {
- $DB::single = 1;
- join(" ", "Foo", shift->next::method)
+ "Foo";
}
1;
Modified: trunk/Class-C3-Componentised/t/lib/MyModule.pm
===================================================================
--- trunk/Class-C3-Componentised/t/lib/MyModule.pm 2007-07-30 13:44:14 UTC (rev 3636)
+++ trunk/Class-C3-Componentised/t/lib/MyModule.pm 2007-07-30 19:23:38 UTC (rev 3637)
@@ -5,7 +5,11 @@
sub component_base_class { "MyModule::Plugin" }
-sub message { "MyModule" }
+sub message {
+ my $msg = $_[0]->maybe::next::method() || '';
+
+ return $msg . " MyModule";
+}
sub new {
return bless {}, shift;
More information about the Bast-commits
mailing list