[Rt-commit] r18929 - in rt/3.999/branches/lorzy: lib/RT lib/RT/Model lib/RT/Shredder t/shredder

clkao at bestpractical.com clkao at bestpractical.com
Wed Mar 25 10:18:45 EDT 2009


Author: clkao
Date: Wed Mar 25 10:18:44 2009
New Revision: 18929

Removed:
   rt/3.999/branches/lorzy/lib/RT/Model/Scrip.pm
   rt/3.999/branches/lorzy/lib/RT/Model/ScripCollection.pm
   rt/3.999/branches/lorzy/lib/RT/Shredder/Scrip.pm
Modified:
   rt/3.999/branches/lorzy/TODO.lorzy
   rt/3.999/branches/lorzy/lib/RT/Shredder.pm
   rt/3.999/branches/lorzy/lib/RT/Shredder/ScripAction.pm
   rt/3.999/branches/lorzy/lib/RT/Shredder/ScripCondition.pm
   rt/3.999/branches/lorzy/lib/RT/Shredder/Template.pm
   rt/3.999/branches/lorzy/lib/RT/Shredder/User.pm
   rt/3.999/branches/lorzy/t/shredder/02queue.t
   rt/3.999/branches/lorzy/t/shredder/02template.t

Log:
remove RT::Model::Scrip.


Modified: rt/3.999/branches/lorzy/TODO.lorzy
==============================================================================
--- rt/3.999/branches/lorzy/TODO.lorzy	(original)
+++ rt/3.999/branches/lorzy/TODO.lorzy	Wed Mar 25 10:18:44 2009
@@ -1,7 +1,9 @@
-* hinting subsystem: fix coderef passing and callback in lorzy
-
 * lorzy code improvements:  control flow handling like return, exception
 
+* test and implement ordering of rules
+
+* lorzy rule model
+
 Per-rule entry:
 
  - on_condition (make it chained filters?), any of:

Modified: rt/3.999/branches/lorzy/lib/RT/Shredder.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Shredder.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Shredder.pm	Wed Mar 25 10:18:44 2009
@@ -218,7 +218,6 @@
     require RT::Shredder::Link;
     require RT::Shredder::Principal;
     require RT::Shredder::Queue;
-    require RT::Shredder::Scrip;
     require RT::Shredder::ScripAction;
     require RT::Shredder::ScripCondition;
     require RT::Shredder::Template;
@@ -239,7 +238,6 @@
     Link
     Principal
     Queue
-    Scrip
     ScripAction
     ScripCondition
     Template

Modified: rt/3.999/branches/lorzy/lib/RT/Shredder/ScripAction.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Shredder/ScripAction.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Shredder/ScripAction.pm	Wed Mar 25 10:18:44 2009
@@ -67,16 +67,6 @@
     my $deps = $args{'dependencies'};
     my $list = [];
 
-    # Scrips
-    my $objs = RT::Model::ScripCollection->new( current_user => $self->current_user );
-    $objs->limit( column => 'ScripAction', value => $self->id );
-    $deps->_push_dependencies(
-        base_object    => $self,
-        flags          => DEPENDS_ON,
-        target_objects => $objs,
-        shredder       => $args{'shredder'}
-    );
-
     return $self->SUPER::__depends_on(%args);
 }
 

Modified: rt/3.999/branches/lorzy/lib/RT/Shredder/ScripCondition.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Shredder/ScripCondition.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Shredder/ScripCondition.pm	Wed Mar 25 10:18:44 2009
@@ -67,15 +67,6 @@
     my $deps = $args{'dependencies'};
     my $list = [];
 
-    # Scrips
-    my $objs = RT::Model::ScripCollection->new( current_user => $self->current_user );
-    $objs->limit( column => 'ScripCondition', value => $self->id );
-    $deps->_push_dependencies(
-        base_object    => $self,
-        flags          => DEPENDS_ON,
-        target_objects => $objs,
-        shredder       => $args{'shredder'}
-    );
 
     return $self->SUPER::__depends_on(%args);
 }

Modified: rt/3.999/branches/lorzy/lib/RT/Shredder/Template.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Shredder/Template.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Shredder/Template.pm	Wed Mar 25 10:18:44 2009
@@ -67,18 +67,6 @@
     my $deps = $args{'dependencies'};
     my $list = [];
 
-    # Scrips
-    my $objs = RT::Model::ScripCollection->new( current_user => $self->current_user );
-    $objs->limit( column => 'template', value => $self->id );
-    push( @$list, $objs );
-
-    $deps->_push_dependencies(
-        base_object    => $self,
-        flags          => DEPENDS_ON,
-        target_objects => $list,
-        shredder       => $args{'shredder'},
-    );
-
     return $self->SUPER::__depends_on(%args);
 }
 

Modified: rt/3.999/branches/lorzy/lib/RT/Shredder/User.pm
==============================================================================
--- rt/3.999/branches/lorzy/lib/RT/Shredder/User.pm	(original)
+++ rt/3.999/branches/lorzy/lib/RT/Shredder/User.pm	Wed Mar 25 10:18:44 2009
@@ -69,7 +69,6 @@
     QueueCollection
     ScripActionCollection
     ScripConditionCollection
-    ScripCollection
     TemplateCollection
     ObjectCustomFieldValueCollection
     TicketCollection

Modified: rt/3.999/branches/lorzy/t/shredder/02queue.t
==============================================================================
--- rt/3.999/branches/lorzy/t/shredder/02queue.t	(original)
+++ rt/3.999/branches/lorzy/t/shredder/02queue.t	Wed Mar 25 10:18:44 2009
@@ -9,7 +9,7 @@
 use RT::Test::Shredder;
 RT::Test::Shredder::init_db();
 
-plan tests => 16;
+plan tests => 13;
 
 diag 'simple queue' if $ENV{'TEST_VERBOSE'};
 {
@@ -24,29 +24,6 @@
 	cmp_deeply( RT::Test::Shredder::dump_current_and_savepoint('clean'), "current DB equal to savepoint");
 }
 
-diag 'queue with scrip' if $ENV{'TEST_VERBOSE'};
-{
-	RT::Test::Shredder::create_savepoint('clean');
-    my $queue = RT::Model::Queue->new(current_user => RT->system_user );
-    my ($id, $msg) = $queue->create( name => 'my queue' );
-    ok($id, 'Created queue') or diag "error: $msg";
-
-    my $scrip = RT::Model::Scrip->new(current_user => RT->system_user );
-    ($id, $msg) = $scrip->create(
-        description    => 'my scrip',
-        queue          => $queue->id,
-        scrip_condition => 'On Create',
-        scrip_action    => 'Open Tickets',
-        template       => 'Blank',
-    );
-    ok($id, 'Created scrip') or diag "error: $msg";
-
-	my $shredder = RT::Test::Shredder::shredder_new();
-	$shredder->put_objects( objects => $queue );
-	$shredder->wipeout_all;
-	cmp_deeply( RT::Test::Shredder::dump_current_and_savepoint('clean'), "current DB equal to savepoint");
-}
-
 diag 'queue with template' if $ENV{'TEST_VERBOSE'};
 {
 	RT::Test::Shredder::create_savepoint('clean');

Modified: rt/3.999/branches/lorzy/t/shredder/02template.t
==============================================================================
--- rt/3.999/branches/lorzy/t/shredder/02template.t	(original)
+++ rt/3.999/branches/lorzy/t/shredder/02template.t	Wed Mar 25 10:18:44 2009
@@ -9,7 +9,7 @@
 use RT::Test::Shredder;
 RT::Test::Shredder::init_db();
 
-plan tests => 7;
+plan tests => 4;
 
 diag 'global template' if $ENV{'TEST_VERBOSE'};
 {
@@ -44,29 +44,3 @@
 	cmp_deeply( RT::Test::Shredder::dump_current_and_savepoint('clean'), "current DB equal to savepoint");
 }
 
-diag 'template used in scrip' if $ENV{'TEST_VERBOSE'};
-{
-	RT::Test::Shredder::create_savepoint('clean');
-    my $template = RT::Model::Template->new(current_user => RT->system_user );
-    my ($id, $msg) = $template->create(
-        name => 'my template',
-        queue => 'General',
-        content => "\nsome content",
-    );
-    ok($id, 'Created template') or diag "error: $msg";
-
-    my $scrip = RT::Model::Scrip->new(current_user => RT->system_user );
-    ($id, $msg) = $scrip->create(
-        description    => 'my scrip',
-        queue          => 'General',
-        scrip_condition => 'On Create',
-        scrip_action    => 'Open Tickets',
-        template       => $template->id,
-    );
-    ok($id, 'Created scrip') or diag "error: $msg";
-
-	my $shredder = RT::Test::Shredder::shredder_new();
-	$shredder->put_objects( objects => $template );
-	$shredder->wipeout_all;
-	cmp_deeply( RT::Test::Shredder::dump_current_and_savepoint('clean'), "current DB equal to savepoint");
-}


More information about the Rt-commit mailing list