[Bps-public-commit] r15410 - in Prophet/trunk/lib/Prophet: CLI/Command

jesse at bestpractical.com jesse at bestpractical.com
Sun Aug 24 11:52:12 EDT 2008


Author: jesse
Date: Sun Aug 24 11:52:10 2008
New Revision: 15410

Modified:
   Prophet/trunk/lib/Prophet/CLI.pm
   Prophet/trunk/lib/Prophet/CLI/Command/Shell.pm

Log:
* Alittle bit of refactoring to make code more readable

Modified: Prophet/trunk/lib/Prophet/CLI.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI.pm	Sun Aug 24 11:52:10 2008
@@ -81,6 +81,9 @@
     },
 );
 
+# clear the prop_set too!
+after clear_props => sub { my $self = shift; $self->prop_set( ( ) ); };
+
 has prop_set => (
     metaclass  => 'Collection::Array',
     is         => 'rw',
@@ -91,6 +94,10 @@
         push => 'add_to_prop_set',
     },
 );
+after add_to_prop_set => sub {
+    my $self = shift; my $args = shift; $self->set_prop($args->{prop} => $args->{value})
+};
+
 
 has interactive_shell => ( 
     is => 'rw',
@@ -364,7 +371,7 @@
     }
 }
 
-=head2 change_attributes ( args => $hashref, props => $hashref, type => 'str' )
+=head2 mutate_attributes ( args => $hashref, props => $hashref, type => 'str' )
 
 A hook for running a second command from within a command without having       
 to use the commandline argument parsing.  
@@ -374,7 +381,7 @@
 
 =cut
 
-sub change_attributes {
+sub mutate_attributes {
     my $self = shift;
     my %args = @_;
 
@@ -405,12 +412,6 @@
     }
 }
 
-# clear the prop_set too!
-after clear_props => sub {
-    my $self = shift;
-    $self->prop_set( ( ) );
-};
-
 =head2 invoke [outhandle], ARGV
 
 Run the given command. If outhandle is true, select that as the file handle
@@ -433,12 +434,6 @@
     return $ret;
 }
 
-after add_to_prop_set => sub {
-    my $self = shift;
-    my $args = shift;
-
-    $self->set_prop($args->{prop} => $args->{value});
-};
 
 __PACKAGE__->meta->make_immutable;
 no Moose;

Modified: Prophet/trunk/lib/Prophet/CLI/Command/Shell.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Shell.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Shell.pm	Sun Aug 24 11:52:10 2008
@@ -81,7 +81,7 @@
 
     my $hist = $ENV{PROPHET_HISTFILE}
             || (($ENV{HOME} || (getpwuid($<))[7]) . "/.prophetreplhist");
-    my $len = $ENV{PROPHET_HISTLEN} || 100;
+    my $len = $ENV{PROPHET_HISTLEN} || 500;
 
     eval {
         local $SIG{__DIE__};



More information about the Bps-public-commit mailing list