[Bps-public-commit] r13800 - in Prophet/branches/moose: .

jesse at bestpractical.com jesse at bestpractical.com
Fri Jul 4 06:47:13 EDT 2008


Author: jesse
Date: Fri Jul  4 06:47:13 2008
New Revision: 13800

Modified:
   Prophet/branches/moose/   (props changed)
   Prophet/branches/moose/Makefile.PL
   Prophet/branches/moose/lib/Prophet/CLI.pm
   Prophet/branches/moose/lib/Prophet/Record.pm
   Prophet/branches/moose/lib/Prophet/Test.pm

Log:
 r39154 at 31b:  jesse | 2008-07-04 12:37:38 +0200
 starting to work to pass tests for sd


Modified: Prophet/branches/moose/Makefile.PL
==============================================================================
--- Prophet/branches/moose/Makefile.PL	(original)
+++ Prophet/branches/moose/Makefile.PL	Fri Jul  4 06:47:13 2008
@@ -29,25 +29,25 @@
 features(
     'REST Server' => [
         -default => 1,
-        recommends('HTTP::Server::Simple'), # HTTP::Server::Simple::CGI
-        recommends('Test::HTTP::Server::Simple'),
-        recommends('Test::WWW::Mechanize' => '1.16'),
-        recommends('HTTP::Server::Simple')
+        'HTTP::Server::Simple', # HTTP::Server::Simple::CGI
+        'Test::HTTP::Server::Simple',
+        'Test::WWW::Mechanize' => '1.16',
+        'HTTP::Server::Simple'
     ],
 
 
     'Subversion replica support' => [
         -default => 0,
-        recommends( 'SVN::Core') # SVN::Repos SVN::Fs SVN::Ra SVN::Delta::Editor SVN::Client SVN::Delta
+         'SVN::Core' # SVN::Repos SVN::Fs SVN::Ra SVN::Delta::Editor SVN::Client SVN::Delta
     ],
     'Maintainer testing tools' => [
         -default   => 1,
-        recommends('Acme::MetaSyntactic'),
-        recommends('Test::POD::Coverage')
+        'Acme::MetaSyntactic',
+        'Test::POD::Coverage'
     ],
-    "Devel::Gladiator support (contact sky at crucially.net if it's not on CPAN)" => [
+    q{Devel::Gladiator support (contact sky at crucially.net if it's not on CPAN)} => [
         -default => 0,
-        recommends('Devel::Gladiator')
+        'Devel::Gladiator'
     ],
     'Testing' => [
         -default => 1,

Modified: Prophet/branches/moose/lib/Prophet/CLI.pm
==============================================================================
--- Prophet/branches/moose/lib/Prophet/CLI.pm	(original)
+++ Prophet/branches/moose/lib/Prophet/CLI.pm	Fri Jul  4 06:47:13 2008
@@ -79,32 +79,31 @@
 
     my @commands = map { exists $CMD_MAP{$_} ? $CMD_MAP{$_} : $_ } @{ $self->primary_commands };
 
-
-
     my @possible_classes;
-    
+
     my @to_try = @commands;
 
-    while( @to_try ) {
-        my $cmd = $self->app_class . "::CLI::Command::" . join( '::', map {ucfirst lc $_} @to_try ) ;    # App::SD::CLI::Command::Ticket::Comment::List
+    while (@to_try) {
+        my $cmd = $self->app_class . "::CLI::Command::" . join( '::', map { ucfirst lc $_ } @to_try );    # App::SD::CLI::Command::Ticket::Comment::List
         push @possible_classes, $cmd;
-        shift @to_try; # throw away that top-level "Ticket" option 
+        shift @to_try;                                                                                    # throw away that top-level "Ticket" option
     }
 
-   my @extreme_fallback_commands = (     $self->app_class . "::CLI::Command::" . ucfirst(lc( $commands[-1] )),    # App::SD::CLI::Command::List
-        "Prophet::CLI::Command::" . ucfirst( lc $commands[-1] ),    # Prophet::CLI::Command::List
+    my @extreme_fallback_commands = (
+        $self->app_class . "::CLI::Command::" . ucfirst( lc( $commands[-1] ) ),                           # App::SD::CLI::Command::List
+        "Prophet::CLI::Command::" . ucfirst( lc $commands[-1] ),                                          # Prophet::CLI::Command::List
         $self->app_class . "::CLI::Command::NotFound",
         "Prophet::CLI::Command::NotFound"
     );
 
     my $class;
 
-    for my $try (@possible_classes, @extreme_fallback_commands) {
+    for my $try ( @possible_classes, @extreme_fallback_commands ) {
         $class = $self->_try_to_load_cmd_class($try);
         last if $class;
     }
 
-    die "I don't know how to parse '" . join(" ", @{$self->primary_commands}) ."'. Are you sure that's a valid command?" unless ($class);
+    die "I don't know how to parse '" . join( " ", @{ $self->primary_commands } ) . "'. Are you sure that's a valid command?" unless ($class);
 
     my $command_obj = $class->new(
         {   cli      => $self,
@@ -120,8 +119,11 @@
     my $self = shift;
     my $class = shift;
     Prophet::App->require_module($class);
+    warn "trying out " .$class;
+    no strict 'refs';
+    warn join(',', @{$class.'::ISA'});
     return $class if ( $class->isa('Prophet::CLI::Command') );
-
+    warn "aw. not it";
     return undef;
 }
 
@@ -368,18 +370,16 @@
 package Prophet::CLI::Command::Create;
 use Moose;
 extends 'Prophet::CLI::Command';
-
-use Moose;
-extends 'Prophet::CLI::Command';
 with 'Prophet::CLI::RecordCommand';
-
 has +uuid => ( required => 0);
 
 sub run {
     my $self   = shift;
     my $record = $self->_get_record;
-
-    $record->create( props => $self->edit_args );
+    my ($val, $msg) = $record->create( props => $self->edit_args );
+    if (!$val) { 
+        warn $msg ."\n";
+    }
     if (!$record->uuid) {
         warn "Failed to create " . $record->record_type . "\n";
         return;

Modified: Prophet/branches/moose/lib/Prophet/Record.pm
==============================================================================
--- Prophet/branches/moose/lib/Prophet/Record.pm	(original)
+++ Prophet/branches/moose/lib/Prophet/Record.pm	Fri Jul  4 06:47:13 2008
@@ -144,7 +144,6 @@
     my $self = shift;
     my %args = validate( @_, { props => 1 } );
     my $uuid = $UUIDGEN->create_str;
-
     $self->canonicalize_props( $args{'props'} );
     $self->validate_props( $args{'props'} ) or return undef;
 

Modified: Prophet/branches/moose/lib/Prophet/Test.pm
==============================================================================
--- Prophet/branches/moose/lib/Prophet/Test.pm	(original)
+++ Prophet/branches/moose/lib/Prophet/Test.pm	Fri Jul  4 06:47:13 2008
@@ -50,7 +50,7 @@
 
 {
     no warnings 'redefine';
-
+    require Test::More;
     sub Test::More::diag {    # bad bad bad # convenient convenient convenient
         Test::More->builder->diag(@_) if ( $Test::Harness::Verbose || $ENV{'TEST_VERBOSE'} );
     }



More information about the Bps-public-commit mailing list