[Bps-public-commit] r15076 - in sd/trunk: . lib/App/SD lib/App/SD/CLI lib/App/SD/Replica/RT

spang at bestpractical.com spang at bestpractical.com
Tue Aug 12 09:29:55 EDT 2008


Author: spang
Date: Tue Aug 12 09:29:55 2008
New Revision: 15076

Modified:
   sd/trunk/   (props changed)
   sd/trunk/Makefile.PL
   sd/trunk/lib/App/SD/CLI/Command.pm
   sd/trunk/lib/App/SD/Model/Ticket.pm
   sd/trunk/lib/App/SD/Record.pm
   sd/trunk/lib/App/SD/Replica/RT/PullEncoder.pm

Log:
 r47499 at loki:  spang | 2008-08-01 15:52:01 +0100
  r47494 at loki (orig r14704):  jesse | 2008-08-01 04:40:24 +0100
  * Removed deps on DateTime and Clone
  r47496 at loki (orig r14706):  sartak | 2008-08-01 14:47:45 +0100
   r68240 at onn:  sartak | 2008-08-01 09:47:29 -0400
   Revert to checking the content arg instead of the content prop, since this is prop-agnostic
  
 


Modified: sd/trunk/Makefile.PL
==============================================================================
--- sd/trunk/Makefile.PL	(original)
+++ sd/trunk/Makefile.PL	Tue Aug 12 09:29:55 2008
@@ -6,14 +6,13 @@
 version_from('lib/App/SD.pm');
 
 requires 'Prophet'; # URI UNIVERSAL::require Params::Validate Path::Class Class::Accessor
-requires('Clone');
 requires('Moose'); # Moose::Role
-requires('DateTime');
 
 features(
     'RT sync' => [
         -default => 0,
         'RT::Client::REST' => 0, # RT::Client::REST::Ticket
+        'HTTP::Date' => 0,
 
     ],
 

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	Tue Aug 12 09:29:55 2008
@@ -32,7 +32,7 @@
     if (my $file = file($self->delete_arg('file'))) {
         $content = $file->slurp();
         $self->set_prop(name => $file->basename);
-    } elsif ($content = $self->delete_prop('content')) {
+    } elsif ($content = $self->delete_arg('content')) {
 
     } elsif ($args{default_edit} || $self->has_arg('edit')) {
         my $text = '';

Modified: sd/trunk/lib/App/SD/Model/Ticket.pm
==============================================================================
--- sd/trunk/lib/App/SD/Model/Ticket.pm	(original)
+++ sd/trunk/lib/App/SD/Model/Ticket.pm	Tue Aug 12 09:29:55 2008
@@ -3,6 +3,7 @@
 extends 'App::SD::Record';
 
 use Term::ANSIColor;
+use HTTP::Date;
 
 use constant collection_class => 'App::SD::Collection::Ticket';
 use constant type => 'ticket';
@@ -96,20 +97,11 @@
         return 0;
     }
 
-    my $dt = eval { DateTime->new(
-            year      => $1,
-            month     => $2,
-            day       => $3,
-            hour      => $4,
-            minute    => $5,
-            second    => $6,
-            time_zone => 'UTC',
-    ) };
-    warn $@ if $@;
-    return 0 if !$dt;
+    my $then = HTTP::Date::str2time($date, 'GMT');
+    return 0 if !$then;
 
-    my $now = DateTime->now(time_zone => 'UTC');
-    return $now > $dt;
+    my $now = time();
+    return $now > $then;
 }
 
 __PACKAGE__->register_reference( comments => 'App::SD::Collection::Comment', by => 'ticket');

Modified: sd/trunk/lib/App/SD/Record.pm
==============================================================================
--- sd/trunk/lib/App/SD/Record.pm	(original)
+++ sd/trunk/lib/App/SD/Record.pm	Tue Aug 12 09:29:55 2008
@@ -4,7 +4,6 @@
 package App::SD::Record; # should probably be Prophet::App::Record
 use Moose;
 use Params::Validate;
-use DateTime;
 
 
 sub declared_props { 'created', inner() }
@@ -25,8 +24,15 @@
                || $props->{date};
 
     if (!$created ) {
-        my $date = DateTime->now;
-        $args{props}->{created} = $date->ymd." ".$date->hms;
+        my @now = gmtime();
+
+        $args{props}->{created} = sprintf(
+            "%04d-%02d-%02d %02d:%02d:%02d",
+            ( $now[5] + 1900 ),
+            ( $now[4] + 1 ),
+            $now[3], $now[2], $now[1], $now[0]
+        );
+
     }
     return 1;
 }

Modified: sd/trunk/lib/App/SD/Replica/RT/PullEncoder.pm
==============================================================================



More information about the Bps-public-commit mailing list