[Bps-public-commit] r15085 - in sd/trunk: . lib/App/SD/CLI/Command/Ticket/Attachment lib/App/SD/CLI/Command/Ticket/Comment

spang at bestpractical.com spang at bestpractical.com
Tue Aug 12 09:32:50 EDT 2008


Author: spang
Date: Tue Aug 12 09:32:49 2008
New Revision: 15085

Modified:
   sd/trunk/   (props changed)
   sd/trunk/lib/App/SD/CLI/Command/Ticket/Attachment/Create.pm
   sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm
   sd/trunk/lib/App/SD/CLI/Command/Ticket/Comments.pm
   sd/trunk/lib/App/SD/CLI/Command/Ticket/Details.pm

Log:
 r47783 at loki:  spang | 2008-08-06 00:58:13 +0100
 make commands that require uuids and don't inherit from prophet commands that also do fail more gracefully when uuid is not set


Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Attachment/Create.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Attachment/Create.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Attachment/Create.pm	Tue Aug 12 09:32:49 2008
@@ -5,6 +5,8 @@
 
 before run => sub {
     my $self = shift;
+    $self->require_uuid;
+
     $self->set_prop(ticket => $self->cli->uuid);
 };
 

Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Comment/Create.pm	Tue Aug 12 09:32:49 2008
@@ -8,6 +8,7 @@
 # override args to feed in that ticket's uuid as an argument to the comment
 before run => sub {
     my $self = shift;
+    $self->require_uuid;
 
     my $content = $self->get_content(type => 'comment', default_edit => 1);
 

Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Comments.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Comments.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Comments.pm	Tue Aug 12 09:32:49 2008
@@ -7,12 +7,14 @@
 sub run {
     my $self = shift;
     my $record = $self->_get_record_class();
-    $record->load( uuid => $self->uuid );
+
+    $self->require_uuid;
+    $record->load( uuid => $uuid );
     unless (@{$record->comments}) {
         print "No comments found\n";
     }
 
-    for my $entry (sort { $a->prop('date') cmp $b->prop('date') } @{$record->comments}) {
+    for my $entry (sort { $a->prop('created') cmp $b->prop('created') } @{$record->comments}) {
          print "id: ".$entry->luid." (".$entry->uuid.")\n";
         print "created: ".$entry->prop('created')."\n";
         print $entry->prop('content')."\n";

Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Details.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Details.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Details.pm	Tue Aug 12 09:32:49 2008
@@ -6,6 +6,8 @@
 
 override run => sub {
     my $self = shift;
+
+    $self->require_uuid;
     my $record = $self->_load_record;
 
     print "\n=head1 METADATA\n\n";



More information about the Bps-public-commit mailing list