add +Debug plugin (as an example)
Jonathan Rockway [Mon, 13 Apr 2009 06:41:06 +0000 (01:41 -0500)]
lib/MooseX/Runnable/Invocation/Plugin/Debug.pm [new file with mode: 0644]

diff --git a/lib/MooseX/Runnable/Invocation/Plugin/Debug.pm b/lib/MooseX/Runnable/Invocation/Plugin/Debug.pm
new file mode 100644 (file)
index 0000000..60db341
--- /dev/null
@@ -0,0 +1,21 @@
+package MooseX::Runnable::Invocation::Plugin::Debug;
+use Moose::Role;
+use Context::Preserve qw(preserve_context);
+
+for my $method (qw/load_class apply_scheme validate_class create_instance start_application/){
+
+    requires $method;
+
+    before $method => sub {
+        my ($self, @args);
+        my $args = join ', ', @args;
+        print "Calling $method($args)\n";
+    };
+
+    after $method => sub {
+        my ($next, $self, @args) = @_;
+        print "Returning from $method\n";
+    };
+}
+
+1;