[Bps-public-commit] r13728 - in sd/trunk: . bin

jesse at bestpractical.com jesse at bestpractical.com
Wed Jul 2 12:06:27 EDT 2008


Author: jesse
Date: Wed Jul  2 12:06:16 2008
New Revision: 13728

Modified:
   sd/trunk/   (props changed)
   sd/trunk/bin/sd
   sd/trunk/lib/App/SD/Replica/Hiveminder.pm
   sd/trunk/lib/App/SD/Replica/RT.pm

Log:
 r39107 at 31b:  jesse | 2008-07-02 12:02:36 +0300
 * Significant moosing of the SD commandline. It almost works. But not quite.
 * SD now only works with a moosed prophet
 * Moose is the future. The future is Now (2 July 2008)
 
     - Topkapi Palace - 2 July 2008
 


Modified: sd/trunk/bin/sd
==============================================================================
--- sd/trunk/bin/sd	(original)
+++ sd/trunk/bin/sd	Wed Jul  2 12:06:16 2008
@@ -11,7 +11,7 @@
 
 
 package App::SD::CLI::Command;
-use base qw/Prophet::CLI::Command/;
+use Moose::Role;
 use Path::Class;
 
 sub get_content {
@@ -35,13 +35,28 @@
     return $content;
 }
 
-package App::SD::CLI::Command::Ticket::Comment;
-use base qw/App::SD::CLI::Command::Ticket/;
+package App::SD::CLI::Model::Ticket;
+use Moose::Role;
+use constant record_class => 'App::SD::Model::Ticket';
 
+package App::SD::CLI::Model::TicketComment;
+use Moose::Role;
 use constant record_class => 'App::SD::Model::Comment';
 
-package App::SD::CLI::Command::Ticket::Comment::Create;
-use base qw/App::SD::CLI::Command::Ticket::Comment Prophet::CLI::Command::Create/;
+package App::SD::CLI::Model::Attachment;
+use Moose::Role;
+use constant record_class => 'App::SD::Model::Attachment';
+
+
+
+
+
+package App::SD::CLI::Model::TicketComment::Create;
+use Moose;
+
+extends 'Prophet::CLI::Command::Create';
+with 'App::SD::CLI::Model::TicketComment';
+
 
 sub run {
     my $self = shift;
@@ -53,12 +68,10 @@
 
 
 
-package App::SD::CLI::Command::Attachment;
-use base qw/App::SD::CLI::Command/;
-use constant record_class => 'App::SD::Model::Attachment';
-
-package App::SD::CLI::Command::Attachment::Create;
-use base qw/App::SD::CLI::Command::Attachment Prophet::CLI::Command::Create/;
+package App::SD::CLI::Model::Attachment::Create;
+use Moose;
+extends 'Prophet::CLI::Command::Create';
+with 'App::SD::CLI::Model::Attachment';
 
 sub run {
     my $self = shift;
@@ -70,10 +83,9 @@
 }
 
 package App::SD::CLI::Command::Ticket::Attachment::Create;
-use base qw/App::SD::CLI::Command::Attachment::Create/;
+use Moose;
+extends qw/App::SD::CLI::Model::Attachment::Create/;
 # override args to feed in that ticket's uuid as an argument to the comment
-#
-
 
 sub run {
     my $self = shift;
@@ -83,7 +95,10 @@
 
 
 package App::SD::CLI::Command::Ticket::Attachment::Search;
-use base qw/App::SD::CLI::Command::Attachment Prophet::CLI::Command::Search/;
+use Moose;
+extends 'Prophet::CLI::Command::Search';
+with 'App::SD::CLI::Model::Attachment';
+
 # override args to feed in that ticket's uuid as an argument to the comment
 
 
@@ -97,8 +112,11 @@
 }
 
 
-package App::SD::CLI::Command::Attachment::Content;
-use base qw/App::SD::CLI::Command::Attachment App::SD::CLI::Command Prophet::CLI::Command::Show/;
+package App::SD::CLI::Model::Attachment::Content;
+use Moose;
+extends 'Prophet::CLI::Command::Show';
+with 'App::SD::CLI::Model::Attachment';
+with 'App::SD::CLI::Command';
 
 sub run {
     my $self = shift;
@@ -108,7 +126,8 @@
 }
 
 package App::SD::CLI::Command::Help;
-use base qw/App::SD::CLI::Command/;
+use Moose; 
+extends 'App::SD::CLI::Command';
 
 sub run {
 
@@ -129,10 +148,16 @@
 }
 
 package App::SD::CLI::Command::Ticket::Show;
-use base qw/App::SD::CLI::Command Prophet::CLI::Command::Show/;
+use Moose;
+extends 'Prophet::CLI::Command::Show';
+with 'App::SD::CLI::Command';
+with 'App::SD::CLI::Model::Ticket';
 
 package App::SD::CLI::Command::Details;
-use base qw/App::SD::CLI::Command/;
+use Moose;
+with 'App::SD::CLI::Command';
+with 'App::SD::CLI::Model::Ticket';
+
 sub run {
     my $self = shift;
     print "\n=head1 METADATA\n\n"; 
@@ -150,13 +175,10 @@
     $bar->App::SD::CLI::Command::Ticket::Comments::run();
 }
 
-package App::SD::CLI::Command::Ticket;
-use base qw/App::SD::CLI::Command/;
-
-use constant record_class => 'App::SD::Model::Ticket';
-
 package App::SD::CLI::Command::Ticket::Comments;
-use base qw/App::SD::CLI::Command::Ticket/;
+use Moose;
+extends 'Prophet::CLI::Command';
+with 'App::SD::CLI::Model::Ticket';
 
 sub run {
     my $self = shift;
@@ -176,10 +198,13 @@
 
 
 package App::SD::CLI::Command::Merge;
-use base qw/App::SD::CLI::Command Prophet::CLI::Command::Merge/;
+use Moose;
+extends qw/Prophet::CLI::Command::Merge/;
+with 'App::SD::CLI::Command';
 
 package App::SD::CLI::Command::Push;
-use base qw/App::SD::CLI::Command::Merge/;
+use Moose;
+extends qw/App::SD::CLI::Command::Merge/;
 
 sub run {
     my $self = shift; 
@@ -190,7 +215,8 @@
 }
 
 package App::SD::CLI::Command::Pull;
-use base qw/App::SD::CLI::Command::Merge/;
+use Moose; 
+extends qw/App::SD::CLI::Command::Merge/;
 
 sub run {
     my $self = shift; 
@@ -204,3 +230,4 @@
     $self->run; 
 }
 
+1;

Modified: sd/trunk/lib/App/SD/Replica/Hiveminder.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/Hiveminder.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/Hiveminder.pm	Wed Jul  2 12:06:16 2008
@@ -2,15 +2,19 @@
 use strict;
 
 package App::SD::Replica::Hiveminder;
-use base qw/Prophet::ForeignReplica/;
+use Moose;
+extends qw/Prophet::ForeignReplica/;
 use Params::Validate qw(:all);
 use UNIVERSAL::require;
 use URI;
 use Memoize;
 use Prophet::ChangeSet;
 
+has hm => ( isa => 'Str', is => 'rw');
+has hm_url => ( isa => 'Str', is => 'rw');
+has hm_username => ( isa => 'Str', is => 'rw');
+
 
-__PACKAGE__->mk_accessors(qw/hm_username hm hm_url/);
 use constant scheme => 'hm';
 
 

Modified: sd/trunk/lib/App/SD/Replica/RT.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/RT.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/RT.pm	Wed Jul  2 12:06:16 2008
@@ -2,7 +2,8 @@
 use strict;
 
 package App::SD::Replica::RT;
-use base qw/Prophet::ForeignReplica/;
+use Moose; 
+extends qw/Prophet::ForeignReplica/;
 use Params::Validate qw(:all);
 use UNIVERSAL::require;
     use File::Temp ();
@@ -12,7 +13,10 @@
 use Memoize;
 use constant scheme => 'rt';
 
-__PACKAGE__->mk_accessors(qw/rt rt_url rt_queue rt_query/);
+has rt => ( isa => 'Str', is => 'rw');
+has rt_url => ( isa => 'Str', is => 'rw');
+has rt_queue => ( isa => 'Str', is => 'rw');
+has rt_query => ( isa => 'Str', is => 'rw');
 
 =head1 NOTES ON PUSH
 



More information about the Bps-public-commit mailing list