[Bps-public-commit] SD - A distributed issue tracker branch, master, updated. 6d1bccdbbf5ba6243e8ab5368f8ddc31b5d2f0dc

jesse jesse at bestpractical.com
Mon Feb 9 23:01:38 EST 2009


The branch, master has been updated
       via  6d1bccdbbf5ba6243e8ab5368f8ddc31b5d2f0dc (commit)
      from  f94e80a846488b1391d37a214d5488f40e5b8e86 (commit)

Summary of changes:
 lib/App/SD/CLI/Command/Shell.pm |   39 +++++++++++++++++++++------------------
 1 files changed, 21 insertions(+), 18 deletions(-)

- Log -----------------------------------------------------------------
commit 6d1bccdbbf5ba6243e8ab5368f8ddc31b5d2f0dc
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Feb 9 23:01:17 2009 -0500

    removal of Class::Method::Modifiers changed how lazy we need to be - rafl++

diff --git a/lib/App/SD/CLI/Command/Shell.pm b/lib/App/SD/CLI/Command/Shell.pm
index fd35d85..d590186 100644
--- a/lib/App/SD/CLI/Command/Shell.pm
+++ b/lib/App/SD/CLI/Command/Shell.pm
@@ -3,37 +3,40 @@ use Any::Moose;
 extends 'Prophet::CLI::Command::Shell';
 
 has project_name => (
-    isa => 'Str',
-    is => 'rw',
-    default => sub { my $self = shift;
-                     if ($self->app_handle->handle->replica_exists) {
-                            return $self->app_handle->setting( label => 'project_name' )->get()->[0]; 
-                        } else {
-                            'No database found';
-                        }
-                        }
-    );
+    isa     => 'Str',
+    is      => 'rw',
+    lazy    => 1,
+    default => sub {
+        my $self = shift;
+        if ( $self->app_handle->handle->replica_exists ) {
+            return $self->app_handle->setting( label => 'project_name' )->get()->[0];
+        } else {
+            return 'No database found';
+        }
+    }
+);
 
 sub preamble {
     my $self = shift;
-     my @out = (   "SD for ".$self->project_name." ($App::SD::VERSION; Prophet $Prophet::VERSION)",
-        'Type "help", "about", or "copying" for more information.');
+    my @out  = (
+        "SD for " . $self->project_name . " ($App::SD::VERSION; Prophet $Prophet::VERSION)",
+        'Type "help", "about", or "copying" for more information.'
+    );
 
-    if (!$self->app_handle->handle->replica_exists) {
-        push @out, '', "No SD database was found at ".$self->app_handle->handle->url(),
-        'Type "help init" and "help environment" for tips on how to sort that out.'
+    if ( !$self->app_handle->handle->replica_exists ) {
+        push @out, '', "No SD database was found at " . $self->app_handle->handle->url(),
+            'Type "help init" and "help environment" for tips on how to sort that out.';
     }
 
-    return join("\n", at out);
+    return join( "\n", @out );
 
 }
 
 sub prompt {
     my $self = shift;
 
-    return $self->project_name."> ";
+    return $self->project_name . "> ";
 }
 
-
 1;
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list