[Bps-public-commit] r16435 - in Prophet/branches/dispatcher: lib/Prophet/CLI

sartak at bestpractical.com sartak at bestpractical.com
Tue Oct 21 13:46:23 EDT 2008


Author: sartak
Date: Tue Oct 21 13:46:16 2008
New Revision: 16435

Added:
   Prophet/branches/dispatcher/lib/Prophet/CLI/Parameters.pm
Modified:
   Prophet/branches/dispatcher/   (props changed)
   Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm

Log:
 r74289 at onn:  sartak | 2008-10-21 13:39:29 -0400
 Add a role (Prophet::CLI::Parameters) for the cli and context attributes


Modified: Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm
==============================================================================
--- Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm	(original)
+++ Prophet/branches/dispatcher/lib/Prophet/CLI/Dispatcher.pm	Tue Oct 21 13:46:16 2008
@@ -1,25 +1,10 @@
 package Prophet::CLI::Dispatcher;
 use Path::Dispatcher::Declarative -base;
 use Moose;
+with 'Prophet::CLI::Parameters';
 
 use Prophet::CLI;
 
-has cli => (
-    is       => 'rw',
-    isa      => 'Prophet::CLI',
-    required => 1,
-);
-
-has context => (
-    is       => 'rw',
-    isa      => 'Prophet::CLIContext',
-    lazy     => 1,
-    default  => sub {
-        my $self = shift;
-        $self->cli->context;
-    },
-);
-
 has dispatching_on => (
     is       => 'rw',
     isa      => 'ArrayRef',

Added: Prophet/branches/dispatcher/lib/Prophet/CLI/Parameters.pm
==============================================================================
--- (empty file)
+++ Prophet/branches/dispatcher/lib/Prophet/CLI/Parameters.pm	Tue Oct 21 13:46:16 2008
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+package Prophet::CLI::Parameters;
+use Moose::Role;
+
+has cli => (
+    is       => 'rw',
+    isa      => 'Prophet::CLI',
+    required => 1,
+);
+
+has context => (
+    is       => 'rw',
+    isa      => 'Prophet::CLIContext',
+    lazy     => 1,
+    default  => sub {
+        my $self = shift;
+        $self->cli->context;
+    },
+);
+
+no Moose::Role;
+
+1;
+



More information about the Bps-public-commit mailing list