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

sartak at bestpractical.com sartak at bestpractical.com
Mon Jul 14 13:42:46 EDT 2008


Author: sartak
Date: Mon Jul 14 13:42:45 2008
New Revision: 14080

Modified:
   sd/trunk/   (props changed)
   sd/trunk/lib/App/SD/CLI/Command.pm
   sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm
   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/Show.pm
   sd/trunk/lib/App/SD/Test.pm

Log:
 r64222 at onn:  sartak | 2008-07-14 13:42:31 -0400
 Set props instead of setting args, some args-handling cleanup


Modified: sd/trunk/lib/App/SD/CLI/Command.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command.pm	Mon Jul 14 13:42:45 2008
@@ -7,12 +7,12 @@
     my $type = shift;
 
     my $content;
-    if (my $file = file(delete $self->args->{'file'})) {
+    if (my $file = file($self->delete_arg('file'))) {
         $content = $file->slurp();
-        $self->args->{'name'} = $file->basename;
-    } elsif ($content = delete $self->args->{'content'}) {
+        $self->set_arg(name => $file->basename);
+    } elsif ($content = $self->delete_arg('content')) {
 
-    } elsif (exists $self->args->{'edit'}) {
+    } elsif ($self->has_arg('edit')) {
         $content = $self->edit_text('');
     } else {
         print "Please type your $type and press ctrl-d.\n";

Modified: sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Attachment/Create.pm	Mon Jul 14 13:42:45 2008
@@ -6,7 +6,7 @@
 
 before run => sub {
     my $self = shift;
-    $self->args->{'content'} = $self->get_content('attachment');
+    $self->set_prop(content => $self->get_content('attachment'));
 };
 
 __PACKAGE__->meta->make_immutable;

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	Mon Jul 14 13:42:45 2008
@@ -5,7 +5,7 @@
 
 before run => sub {
     my $self = shift;
-    $self->args->{'ticket'} = $self->cli->uuid;
+    $self->set_prop(ticket => $self->cli->uuid);
 };
 
 __PACKAGE__->meta->make_immutable;

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	Mon Jul 14 13:42:45 2008
@@ -8,8 +8,8 @@
 # override args to feed in that ticket's uuid as an argument to the comment
 before run => sub {
     my $self = shift;
-    $self->args->{'ticket'} = $self->cli->uuid;
-    $self->args->{'content'} = $self->get_content('comment');
+    $self->set_prop(ticket => $self->cli->uuid);
+    $self->set_prop(content => $self->get_content('comment'));
 };
 
 __PACKAGE__->meta->make_immutable;

Modified: sd/trunk/lib/App/SD/CLI/Command/Ticket/Show.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Ticket/Show.pm	(original)
+++ sd/trunk/lib/App/SD/CLI/Command/Ticket/Show.pm	Mon Jul 14 13:42:45 2008
@@ -6,5 +6,6 @@
 
 __PACKAGE__->meta->make_immutable;
 no Moose;
+
 1;
 

Modified: sd/trunk/lib/App/SD/Test.pm
==============================================================================
--- sd/trunk/lib/App/SD/Test.pm	(original)
+++ sd/trunk/lib/App/SD/Test.pm	Mon Jul 14 13:42:45 2008
@@ -10,7 +10,7 @@
 sub create_ticket_ok {
     my @args = (@_);
     my ( $uuid, $luid );
-    Prophet::Test::run_output_matches( 'sd', [ 'ticket', 'create', @args ],
+    Prophet::Test::run_output_matches( 'sd', [ 'ticket', 'create', '--', @args ],
         [qr/Created ticket (.*?)(?{ $luid = $1})\s+\((.*)(?{ $uuid = $2 })\)/]
     );
 



More information about the Bps-public-commit mailing list