[Rt-commit] r10652 - in rt/branches/3.999-DANGEROUS: lib/RT lib/RT/Shredder t/shredder
ruz at bestpractical.com
ruz at bestpractical.com
Thu Jan 31 22:31:48 EST 2008
Author: ruz
Date: Thu Jan 31 22:31:48 2008
New Revision: 10652
Modified:
rt/branches/3.999-DANGEROUS/lib/RT/Shredder.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ACE.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Attachment.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CachedGroupMember.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CustomField.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CustomFieldValue.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Dependencies.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Dependency.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Group.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/GroupMember.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Link.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ObjectCustomFieldValue.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Objects.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/SQLDump.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Summary.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Tickets.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Principal.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Queue.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Record.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Scrip.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ScripAction.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ScripCondition.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Template.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Ticket.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Transaction.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/User.pm
rt/branches/3.999-DANGEROUS/t/shredder/02queue.t
rt/branches/3.999-DANGEROUS/t/shredder/02template.t
rt/branches/3.999-DANGEROUS/t/shredder/02user.t
rt/branches/3.999-DANGEROUS/t/shredder/03plugin_tickets.t
rt/branches/3.999-DANGEROUS/t/shredder/utils.pl
Log:
* shredder updates
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder.pm Thu Jan 31 22:31:48 2008
@@ -241,7 +241,7 @@
Queue
Scrip
ScripAction
- scrip_condition
+ ScripCondition
Template
ObjectCustomFieldValue
Ticket
@@ -268,7 +268,7 @@
sub init {
%opt = @_;
RT::load_config();
- RT::Init();
+ RT::init();
}
=head4 new
@@ -412,7 +412,7 @@
my $str = $obj->_as_string;
return ( $self->{'cache'}->{$str}
- ||= { State => ON_STACK, object => $obj } );
+ ||= { state => ON_STACK, object => $obj } );
}
=head4 Getobject, GetState, GetRecord( String => ''| object => '' )
@@ -430,22 +430,22 @@
sub _parse_ref_str_args {
my $self = shift;
my %args = (
- String => '',
+ string => '',
object => undef,
@_
);
- if ( $args{'String'} && $args{'object'} ) {
+ if ( $args{'string'} && $args{'object'} ) {
require Carp;
Carp::croak("both String and object args passed");
}
- return $args{'String'} if $args{'String'};
+ return $args{'string'} if $args{'string'};
return $args{'object'}->_as_string
if UNIVERSAL::can( $args{'object'}, '_as_string' );
return '';
}
sub get_object { return (shift)->get_record(@_)->{'object'} }
-sub get_state { return (shift)->get_record(@_)->{'State'} }
+sub get_state { return (shift)->get_record(@_)->{'state'} }
sub get_record {
my $self = shift;
@@ -464,40 +464,40 @@
sub put_resolver {
my $self = shift;
my %args = (
- baseClass => '',
- targetClass => '',
- Code => undef,
+ base_class => '',
+ target_class => '',
+ code => undef,
@_,
);
- unless ( UNIVERSAL::isa( $args{'Code'} => 'CODE' ) ) {
+ unless ( UNIVERSAL::isa( $args{'code'} => 'CODE' ) ) {
die "Resolver '$args{Code}' is not code reference";
}
- my $resolvers = ( ( $self->{'resolver'}->{ $args{'baseClass'} } ||= {} )
- ->{ $args{'targetClass'} || '' } ||= [] );
- unshift @$resolvers, $args{'Code'};
+ my $resolvers = ( ( $self->{'resolver'}->{ $args{'base_class'} } ||= {} )
+ ->{ $args{'target_class'} || '' } ||= [] );
+ unshift @$resolvers, $args{'code'};
return;
}
sub get_resolvers {
my $self = shift;
my %args = (
- baseClass => '',
- targetClass => '',
+ base_class => '',
+ target_class => '',
@_,
);
my @res;
- if ( $args{'targetClass'}
- && exists $self->{'resolver'}->{ $args{'baseClass'} }
- ->{ $args{'targetClass'} } )
+ if ( $args{'target_class'}
+ && exists $self->{'resolver'}->{ $args{'base_class'} }
+ ->{ $args{'target_class'} } )
{
push @res,
- @{ $self->{'resolver'}->{ $args{'baseClass'} }
- ->{ $args{'targetClass'} || '' } };
+ @{ $self->{'resolver'}->{ $args{'base_class'} }
+ ->{ $args{'target_class'} || '' } };
}
- if ( exists $self->{'resolver'}->{ $args{'baseClass'} }->{''} ) {
- push @res, @{ $self->{'resolver'}->{ $args{'baseClass'} }->{''} };
+ if ( exists $self->{'resolver'}->{ $args{'base_class'} }->{''} ) {
+ push @res, @{ $self->{'resolver'}->{ $args{'base_class'} }->{''} };
}
return @res;
@@ -505,12 +505,12 @@
sub apply_resolvers {
my $self = shift;
- my %args = ( Dependency => undef, @_ );
- my $dep = $args{'Dependency'};
+ my %args = ( dependency => undef, @_ );
+ my $dep = $args{'dependency'};
my @resolvers = $self->get_resolvers(
- baseClass => $dep->base_class,
- targetClass => $dep->target_class,
+ base_class => $dep->base_class,
+ target_class => $dep->target_class,
);
unless (@resolvers) {
@@ -521,9 +521,9 @@
);
}
$_->(
- Shredder => $self,
+ shredder => $self,
base_object => $dep->base_object,
- targetobject => $dep->target_object,
+ target_object => $dep->target_object,
) foreach @resolvers;
return;
@@ -533,7 +533,7 @@
my $self = $_[0];
while ( my ( $k, $v ) = each %{ $self->{'cache'} } ) {
- next if $v->{'State'} & ( WIPED | IN_WIPING );
+ next if $v->{'state'} & ( WIPED | IN_WIPING );
$self->wipeout( object => $v->{'object'} );
}
}
@@ -546,12 +546,12 @@
unless Jifty->handle->begin_transaction;
$mark = $self->push_dump_mark or die "Couldn't get dump mark";
$self->_wipeout(@_);
- $self->pop_dump_mark( Mark => $mark );
+ $self->pop_dump_mark( mark => $mark );
die "Couldn't commit transaction" unless Jifty->handle->commit;
};
if ($@) {
Jifty->handle->rollback('force');
- $self->rollback_dump_to( Mark => $mark ) if $mark;
+ $self->rollback_dump_to( mark => $mark ) if $mark;
die $@ if RT::Shredder::Exception::Info->caught;
die "Couldn't wipeout object: $@";
}
@@ -559,51 +559,51 @@
sub _wipeout {
my $self = shift;
- my %args = ( CacheRecord => undef, object => undef, @_ );
+ my %args = ( cache_record => undef, object => undef, @_ );
- my $record = $args{'CacheRecord'};
+ my $record = $args{'cache_record'};
$record = $self->put_object( object => $args{'object'} ) unless $record;
- return if $record->{'State'} & ( WIPED | IN_WIPING );
+ return if $record->{'state'} & ( WIPED | IN_WIPING );
- $record->{'State'} |= IN_WIPING;
+ $record->{'state'} |= IN_WIPING;
my $object = $record->{'object'};
- $self->dump_object( object => $object, State => 'before any action' );
+ $self->dump_object( object => $object, state => 'before any action' );
unless ( $object->before_wipeout ) {
RT::Shredder::Exception->throw("BeforeWipeout check returned error");
}
- my $deps = $object->dependencies( Shredder => $self );
+ my $deps = $object->dependencies( shredder => $self );
$deps->list(
- WithFlags => DEPENDS_ON | VARIABLE,
- Callback => sub { $self->apply_resolvers( Dependency => $_[0] ) },
+ with_flags => DEPENDS_ON | VARIABLE,
+ callback => sub { $self->apply_resolvers( dependency => $_[0] ) },
);
- $self->dump_object( object => $object, State => 'after resolvers' );
+ $self->dump_object( object => $object, state => 'after resolvers' );
$deps->list(
- WithFlags => DEPENDS_ON,
- WithoutFlags => WIPE_AFTER | VARIABLE,
- Callback => sub { $self->_wipeout( object => $_[0]->target_object ) },
+ with_flags => DEPENDS_ON,
+ without_flags => WIPE_AFTER | VARIABLE,
+ callback => sub { $self->_wipeout( object => $_[0]->target_object ) },
);
$self->dump_object(
object => $object,
- State => 'after wiping dependencies'
+ state => 'after wiping dependencies'
);
$object->__wipeout;
- $record->{'State'} |= WIPED;
+ $record->{'state'} |= WIPED;
delete $record->{'object'};
- $self->dump_object( object => $object, State => 'after wipeout' );
+ $self->dump_object( object => $object, state => 'after wipeout' );
$deps->list(
- WithFlags => DEPENDS_ON | WIPE_AFTER,
- WithoutFlags => VARIABLE,
- Callback => sub { $self->_wipeout( object => $_[0]->target_object ) },
+ with_flags => DEPENDS_ON | WIPE_AFTER,
+ without_flags => VARIABLE,
+ callback => sub { $self->_wipeout( object => $_[0]->target_object ) },
);
$self->dump_object(
object => $object,
- State => 'after late dependencies'
+ state => 'after late dependencies'
);
return;
@@ -614,8 +614,8 @@
my %args = (@_);
foreach my $record ( values %{ $self->{'cache'} } ) {
- next if ( $record->{'State'} & VALID );
- $record->{'object'}->validate_relations( Shredder => $self );
+ next if ( $record->{'state'} & VALID );
+ $record->{'object'}->validate_relations( shredder => $self );
}
}
@@ -661,10 +661,10 @@
sub get_filename {
my $self = shift;
- my %args = ( Filename => '', FromStorage => 1, @_ );
+ my %args = ( filename => '', from_storage => 1, @_ );
# default value
- my $file = $args{'Filename'} || '%t-XXXX.sql';
+ my $file = $args{'filename'} || '%t-XXXX.sql';
if ( $file =~ /\%t/i ) {
require POSIX;
my $date_time = POSIX::strftime( "%Y%m%dT%H%M%S", gmtime );
@@ -672,7 +672,7 @@
}
# convert to absolute path
- if ( $args{'FromStorage'} ) {
+ if ( $args{'from_storage'} ) {
$file = File::Spec->catfile( $self->storage_path, $file );
} elsif ( !File::Spec->file_name_is_absolute($file) ) {
$file = File::Spec->rel2abs($file);
@@ -732,7 +732,7 @@
sub add_dump_plugin {
my $self = shift;
- my %args = ( object => undef, name => 'SQLDump', Arguments => undef, @_ );
+ my %args = ( object => undef, name => 'SQLDump', arguments => undef, @_ );
my $plugin = $args{'object'};
unless ($plugin) {
@@ -743,7 +743,7 @@
}
die "Plugin is not of correct type" unless lc $plugin->type eq 'dump';
- if ( my $pargs = $args{'Arguments'} ) {
+ if ( my $pargs = $args{'arguments'} ) {
my ( $status, $msg ) = $plugin->test_args(%$pargs);
die "Couldn't set plugin args: $msg\n" unless $status;
}
@@ -759,12 +759,12 @@
sub dump_object {
my $self = shift;
- my %args = ( object => undef, State => undef, @_ );
- die "No state passed" unless $args{'State'};
- return unless $active_dump_state{ lc $args{'State'} };
+ my %args = ( object => undef, state => undef, @_ );
+ die "No state passed" unless $args{'state'};
+ return unless $active_dump_state{ lc $args{'state'} };
foreach ( @{ $self->{'dump_plugins'} } ) {
- next unless grep lc $args{'State'} eq lc $_, $_->applies_to_states;
+ next unless grep lc $args{'state'} eq lc $_, $_->applies_to_states;
my ( $state, $msg ) = $_->run(%args);
die "Couldn't run plugin: $msg" unless $state;
}
@@ -777,7 +777,7 @@
my $self = shift;
$mark++;
foreach ( @{ $self->{'dump_plugins'} } ) {
- my ( $state, $msg ) = $_->push_mark( Mark => $mark );
+ my ( $state, $msg ) = $_->push_mark( mark => $mark );
die "Couldn't push mark: $msg" unless $state;
}
return $mark;
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ACE.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ACE.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ACE.pm Thu Jan 31 22:31:48 2008
@@ -60,18 +60,18 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
}
@@ -79,18 +79,18 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Attachment.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Attachment.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Attachment.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Nested attachments
@@ -83,9 +83,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
}
@@ -93,11 +93,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Parent, nested parts
@@ -105,9 +105,9 @@
if ( $self->parent_obj && $self->parent_id ) {
push( @$list, $self->parent_obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no parent attachment #" . $self->parent . " object";
}
@@ -118,9 +118,9 @@
if ( defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related transaction #"
. $self->transaction_id
@@ -129,9 +129,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CachedGroupMember.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CachedGroupMember.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CachedGroupMember.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# deep memebership
@@ -98,9 +98,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
@@ -112,20 +112,20 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
my $obj = $self->member_obj;
if ( $obj && $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related Principal #" . $self->member_id . " object.";
}
@@ -134,18 +134,18 @@
if ( $obj && $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related Principal #" . $self->group_id . " object.";
}
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CustomField.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CustomField.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CustomField.pm Thu Jan 31 22:31:48 2008
@@ -62,11 +62,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Custom field values
@@ -79,9 +79,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
}
@@ -89,11 +89,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
my $obj = $self->object;
@@ -104,9 +104,9 @@
if ( $self->queue_obj && $self->queue_obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related queue #" . $self->queue . " object";
}
@@ -114,9 +114,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CustomFieldValue.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CustomFieldValue.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CustomFieldValue.pm Thu Jan 31 22:31:48 2008
@@ -64,29 +64,29 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
my $obj = $self->custom_field_obj;
if ( $obj && defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related CustomField #" . $self->id . " object";
}
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->__relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Dependencies.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Dependencies.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Dependencies.pm Thu Jan 31 22:31:48 2008
@@ -84,10 +84,10 @@
sub _push_dependencies {
my $self = shift;
- my %args = ( target_objects => undef, Shredder => undef, @_ );
- my @objs = $args{'Shredder'}
+ my %args = ( target_objects => undef, shredder => undef, @_ );
+ my @objs = $args{'shredder'}
->cast_objects_to_records( objects => delete $args{'target_objects'} );
- $self->_push_dependency( %args, targetobject => $_ ) foreach @objs;
+ $self->_push_dependency( %args, target_object => $_ ) foreach @objs;
return;
}
@@ -95,20 +95,20 @@
my $self = shift;
my %args = (
base_object => undef,
- Flags => undef,
- targetobject => undef,
- Shredder => undef,
+ flags => undef,
+ target_object => undef,
+ shredder => undef,
@_
);
my $rec
- = $args{'Shredder'}->put_object( object => $args{'targetobject'} );
- return if $rec->{'State'} & WIPED; # there is no object anymore
+ = $args{'shredder'}->put_object( object => $args{'target_object'} );
+ return if $rec->{'state'} & WIPED; # there is no object anymore
push @{ $self->{'list'} },
RT::Shredder::Dependency->new(
base_object => $args{'base_object'},
- Flags => $args{'Flags'},
- targetobject => $rec->{'object'},
+ flags => $args{'flags'},
+ target_object => $rec->{'object'},
);
if ( scalar @{ $self->{'list'} } > ( $RT::DependenciesLimit || 1000 ) ) {
@@ -125,16 +125,16 @@
sub list {
my $self = shift;
my %args = (
- WithFlags => undef,
- WithoutFlags => undef,
- Callback => undef,
+ with_flags => undef,
+ without_flags => undef,
+ callback => undef,
@_
);
- my $wflags = delete $args{'WithFlags'};
- my $woflags = delete $args{'WithoutFlags'};
+ my $wflags = delete $args{'with_flags'};
+ my $woflags = delete $args{'without_flags'};
- return map $args{'Callback'} ? $args{'Callback'}->($_) : $_,
+ return map $args{'callback'} ? $args{'callback'}->($_) : $_,
grep !defined($wflags) || ( $_->flags & $wflags ) == $wflags,
grep !defined($woflags) || !( $_->flags & $woflags ),
@{ $self->{'list'} };
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Dependency.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Dependency.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Dependency.pm Thu Jan 31 22:31:48 2008
@@ -67,8 +67,8 @@
sub set {
my $self = shift;
- my %args = ( Flags => DEPENDS_ON, @_ );
- my @keys = qw(Flags base_object targetobject);
+ my %args = ( flags => DEPENDS_ON, @_ );
+ my @keys = qw(flags base_object target_object);
@$self{@keys} = @args{@keys};
return;
@@ -82,9 +82,9 @@
return $res;
}
-sub flags { return $_[0]->{'Flags'} }
+sub flags { return $_[0]->{'flags'} }
-sub flags_as_String {
+sub flags_as_string {
my $self = shift;
my @res = ();
foreach ( sort keys %FlagDescs ) {
@@ -97,10 +97,10 @@
}
sub base_object { return $_[0]->{'base_object'} }
-sub target_object { return $_[0]->{'targetobject'} }
-sub object { return shift()->{ ( {@_} )->{Type} . "object" } }
+sub target_object { return $_[0]->{'target_object'} }
+sub object { return shift()->{ ( {@_} )->{type} . "_object" } }
-sub target_class { return ref $_[0]->{'targetobject'} }
+sub target_class { return ref $_[0]->{'target_object'} }
sub base_class { return ref $_[0]->{'base_object'} }
sub class { return ref shift()->object(@_) }
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Group.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Group.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Group.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# User is inconsistent without own Equivalence group
@@ -76,18 +76,18 @@
$objs->load( $self->instance );
$deps->_push_dependency(
base_object => $self,
- Flags => DEPENDS_ON | WIPE_AFTER,
- targetobject => $objs,
- Shredder => $args{'Shredder'}
+ flags => DEPENDS_ON | WIPE_AFTER,
+ target_object => $objs,
+ shredder => $args{'shredder'}
);
}
# Principal
$deps->_push_dependency(
base_object => $self,
- Flags => DEPENDS_ON | WIPE_AFTER,
- targetobject => $self->principal_object,
- Shredder => $args{'Shredder'}
+ flags => DEPENDS_ON | WIPE_AFTER,
+ target_object => $self->principal_object,
+ shredder => $args{'shredder'}
);
# Group members records
@@ -120,9 +120,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
}
@@ -130,11 +130,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Equivalence group id inconsistent without User
@@ -144,9 +144,9 @@
if ( $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "ACLEguvivalence group have no related User #"
. $self->instance
@@ -159,18 +159,18 @@
if ( $obj && $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related Principal #" . $self->id . " object.";
}
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/GroupMember.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/GroupMember.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/GroupMember.pm Thu Jan 31 22:31:48 2008
@@ -62,11 +62,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
my $objs = RT::Model::CachedGroupMemberCollection->new;
@@ -78,9 +78,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
my $group = $self->group_obj->object;
@@ -96,18 +96,18 @@
# we don't delete group, so we have to fix Ticket and Group
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON | VARIABLE,
+ flags => DEPENDS_ON | VARIABLE,
target_objects => $group,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
- $args{'Shredder'}->put_resolver(
- baseClass => ref $self,
- targetClass => ref $group,
- Code => sub {
+ $args{'shredder'}->put_resolver(
+ base_class => ref $self,
+ target_class => ref $group,
+ code => sub {
my %args = (@_);
- my $group = $args{'targetobject'};
+ my $group = $args{'target_object'};
return
- if $args{'Shredder'}->get_state( object => $group )
+ if $args{'shredder'}->get_state( object => $group )
& ( WIPED | IN_WIPING );
return unless ( $group->type || '' ) eq 'Owner';
return
@@ -150,20 +150,20 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
my $obj = $self->member_obj;
if ( $obj && $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related Principal #" . $self->member_id . " object.";
}
@@ -172,18 +172,18 @@
if ( $obj && $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related Principal #" . $self->group_id . " object.";
}
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Link.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Link.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Link.pm Thu Jan 31 22:31:48 2008
@@ -63,11 +63,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# add_link transactions
@@ -112,9 +112,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON | WIPE_AFTER,
+ flags => DEPENDS_ON | WIPE_AFTER,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
}
@@ -125,11 +125,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# FIXME: if link is local then object should exist
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ObjectCustomFieldValue.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ObjectCustomFieldValue.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ObjectCustomFieldValue.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
return $self->SUPER::__depends_on(%args);
@@ -73,11 +73,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Ticket
@@ -85,9 +85,9 @@
if ( defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related Ticket #" . $self->id . " object";
}
@@ -97,18 +97,18 @@
if ( defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related CustomField #" . $self->id . " object";
}
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Objects.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Objects.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Objects.pm Thu Jan 31 22:31:48 2008
@@ -96,7 +96,7 @@
sub run {
my $self = shift;
- my %args = ( Shredder => undef, @_ );
+ my %args = ( shredder => undef, @_ );
return ( 1, @{ $self->{'opt'}->{'objects'} } );
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/SQLDump.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/SQLDump.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/SQLDump.pm Thu Jan 31 22:31:48 2008
@@ -57,16 +57,16 @@
sub support_args {
my $self = shift;
- return $self->SUPER::support_args, qw(file_name from_storage);
+ return $self->SUPER::support_args, qw(filename from_storage);
}
sub test_args {
my $self = shift;
my %args = @_;
$args{'from_storage'} = 1 unless defined $args{'from_storage'};
- my $file = $args{'file_name'} = RT::Shredder->get_filename(
- Filename => $args{'file_name'},
- FromStorage => delete $args{'from_storage'},
+ my $file = $args{'filename'} = RT::Shredder->get_filename(
+ filename => $args{'filename'},
+ from_storage => delete $args{'from_storage'},
);
open $args{'file_handle'}, ">:raw", $file
or return ( 0, "Couldn't open '$file' for write: $!" );
@@ -74,7 +74,7 @@
return $self->SUPER::test_args(%args);
}
-sub filename { return $_[0]->{'opt'}{'file_name'} }
+sub filename { return $_[0]->{'opt'}{'filename'} }
sub file_handle { return $_[0]->{'opt'}{'file_handle'} }
sub run {
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Summary.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Summary.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Summary.pm Thu Jan 31 22:31:48 2008
@@ -56,10 +56,10 @@
sub test_args {
my $self = shift;
- my %args = ( file_name => '', @_ );
- unless ( $args{'file_name'} ) {
+ my %args = ( filename => '', @_ );
+ unless ( $args{'filename'} ) {
require POSIX;
- $args{'file_name'}
+ $args{'filename'}
= POSIX::strftime( "summary-%Y%m%dT%H%M%S.XXXX.txt", gmtime );
}
return $self->SUPER::test_args(%args);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Tickets.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Tickets.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Tickets.pm Thu Jan 31 22:31:48 2008
@@ -122,7 +122,7 @@
$self->fetch_next( $objs, 1 );
while ( my $obj = $self->fetch_next($objs) ) {
next if $seen{ $obj->id }++;
- push @linked, $self->get_linked( object => $obj, Seen => \%seen );
+ push @linked, $self->get_linked( object => $obj, seen => \%seen );
push @top, $obj;
last
if $self->{'opt'}{'limit'}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Plugin/Users.pm Thu Jan 31 22:31:48 2008
@@ -128,7 +128,7 @@
sub run {
my $self = shift;
- my %args = ( Shredder => undef, @_ );
+ my %args = ( shredder => undef, @_ );
my $objs
= RT::Model::UserCollection->new( current_user => RT->system_user );
@@ -168,7 +168,7 @@
if ( $self->{'opt'}{'no_tickets'} ) {
return $self->filter_without_tickets(
- Shredder => $args{'Shredder'},
+ shredder => $args{'shredder'},
objects => $objs,
);
} else {
@@ -181,21 +181,21 @@
sub set_Resolvers {
my $self = shift;
- my %args = ( Shredder => undef, @_ );
+ my %args = ( shredder => undef, @_ );
if ( $self->{'opt'}{'replace_relations'} ) {
my $uid = $self->{'opt'}{'replace_relations'};
my $resolver = sub {
my %args = (@_);
- my $t = $args{'targetobject'};
+ my $t = $args{'target_object'};
foreach my $method (qw(Creator last_updated_by)) {
next unless $t->_accessible( $method => 'read' );
$t->__set( column => $method, value => $uid );
}
};
- $args{'Shredder'}->put_resolver(
- baseClass => 'RT::Model::User',
- Code => $resolver
+ $args{'shredder'}->put_resolver(
+ base_class => 'RT::Model::User',
+ code => $resolver
);
}
return (1);
@@ -204,7 +204,7 @@
sub filter_without_tickets {
my $self = shift;
my %args = (
- Shredder => undef,
+ shredder => undef,
objects => undef,
@_,
);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Principal.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Principal.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Principal.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Group or User
@@ -85,9 +85,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
}
@@ -95,29 +95,29 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
my $obj = $self->object;
if ( defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related " . $self->type . " #" . $self->id . " object";
}
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Queue.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Queue.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Queue.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Tickets
@@ -95,9 +95,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Record.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Record.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Record.pm Thu Jan 31 22:31:48 2008
@@ -103,8 +103,8 @@
sub dependencies {
my $self = shift;
my %args = (
- Shredder => undef,
- Flags => DEPENDS_ON,
+ shredder => undef,
+ flags => DEPENDS_ON,
@_,
);
@@ -113,11 +113,11 @@
}
my $deps = RT::Shredder::Dependencies->new();
- if ( $args{'Flags'} & DEPENDS_ON ) {
- $self->__depends_on( %args, Dependencies => $deps );
+ if ( $args{'flags'} & DEPENDS_ON ) {
+ $self->__depends_on( %args, dependencies => $deps );
}
- if ( $args{'Flags'} & RELATES ) {
- $self->__relates( %args, Dependencies => $deps );
+ if ( $args{'flags'} & RELATES ) {
+ $self->__relates( %args, dependencies => $deps );
}
return $deps;
}
@@ -125,11 +125,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# object custom field values
@@ -167,9 +167,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return;
}
@@ -177,11 +177,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
if ( $self->can('Creator') ) {
@@ -191,9 +191,9 @@
if ( $obj && defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
push @{ $rec->{'description'} },
"Have no related User(Creator) #"
. $self->creator
@@ -208,9 +208,9 @@
if ( $obj && defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
push @{ $rec->{'description'} },
"Have no related User(last_updated_by) #"
. $self->last_updated_by
@@ -220,15 +220,15 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
# cause of this $self->SUPER::__Relates should be called last
# in overridden subs
- my $rec = $args{'Shredder'}->get_record( object => $self );
- $rec->{'State'} |= VALID unless ( $rec->{'State'} & INVALID );
+ my $rec = $args{'shredder'}->get_record( object => $self );
+ $rec->{'state'} |= VALID unless ( $rec->{'state'} & INVALID );
return;
}
@@ -246,19 +246,19 @@
sub validate_relations {
my $self = shift;
my %args = (
- Shredder => undef,
+ shredder => undef,
@_
);
- unless ( $args{'Shredder'} ) {
- $args{'Shredder'} = RT::Shredder->new();
+ unless ( $args{'shredder'} ) {
+ $args{'shredder'} = RT::Shredder->new();
}
- my $rec = $args{'Shredder'}->put_object( object => $self );
- return if ( $rec->{'State'} & VALID );
+ my $rec = $args{'shredder'}->put_object( object => $self );
+ return if ( $rec->{'state'} & VALID );
$self = $rec->{'object'};
- $self->_validate_relations( %args, Flags => RELATES );
- $rec->{'State'} |= VALID unless ( $rec->{'State'} & INVALID );
+ $self->_validate_relations( %args, flags => RELATES );
+ $rec->{'state'} |= VALID unless ( $rec->{'state'} & INVALID );
return;
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Scrip.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Scrip.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Scrip.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# No dependencies that should be deleted with record
@@ -76,11 +76,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Queue
@@ -88,9 +88,9 @@
if ( defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related queue #" . $self->id . " object";
}
@@ -100,9 +100,9 @@
if ( defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related ScripCondition #" . $self->id . " object";
}
@@ -112,18 +112,18 @@
if ( defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related ScripAction #" . $self->id . " object";
}
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ScripAction.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ScripAction.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ScripAction.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Scrips
@@ -72,9 +72,9 @@
$objs->limit( column => 'ScripAction', value => $self->id );
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $objs,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
@@ -83,11 +83,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# TODO: Check here for exec module
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ScripCondition.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ScripCondition.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/ScripCondition.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Scrips
@@ -72,9 +72,9 @@
$objs->limit( column => 'ScripCondition', value => $self->id );
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $objs,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
@@ -83,11 +83,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# TODO: Check here for exec module
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Template.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Template.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Template.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Scrips
@@ -74,9 +74,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'},
+ shredder => $args{'shredder'},
);
return $self->SUPER::__depends_on(%args);
@@ -85,11 +85,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Queue
@@ -97,9 +97,9 @@
if ( $obj && defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related queue #" . $self->id . " object";
}
@@ -108,9 +108,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Ticket.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Ticket.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Ticket.pm Thu Jan 31 22:31:48 2008
@@ -60,11 +60,11 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Tickets which were merged in
@@ -83,9 +83,9 @@
#TODO: Users, Queues if we wish export tool
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
@@ -94,11 +94,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Queue
@@ -106,18 +106,18 @@
if ( $obj && defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related queue #" . $self->queue . " object";
}
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Transaction.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Transaction.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Transaction.pm Thu Jan 31 22:31:48 2008
@@ -60,19 +60,19 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Attachments
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $self->attachments,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
@@ -81,11 +81,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Ticket
@@ -93,9 +93,9 @@
if ( $obj && defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related Ticket #" . $self->id . " object";
}
@@ -104,9 +104,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/User.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/User.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/User.pm Thu Jan 31 22:31:48 2008
@@ -80,19 +80,19 @@
sub __depends_on {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Principal
$deps->_push_dependency(
base_object => $self,
- Flags => DEPENDS_ON | WIPE_AFTER,
- targetobject => $self->principal_object,
- Shredder => $args{'Shredder'}
+ flags => DEPENDS_ON | WIPE_AFTER,
+ target_object => $self->principal_object,
+ shredder => $args{'shredder'}
);
# ACL equivalence group
@@ -109,9 +109,9 @@
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON,
+ flags => DEPENDS_ON,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
# TODO: Almost all objects has Creator, last_updated_by and etc. fields
@@ -128,9 +128,9 @@
}
$deps->_push_dependencies(
base_object => $self,
- Flags => DEPENDS_ON | VARIABLE,
+ flags => DEPENDS_ON | VARIABLE,
target_objects => \@var_objs,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__depends_on(%args);
@@ -139,11 +139,11 @@
sub __Relates {
my $self = shift;
my %args = (
- Shredder => undef,
- Dependencies => undef,
+ shredder => undef,
+ dependencies => undef,
@_,
);
- my $deps = $args{'Dependencies'};
+ my $deps = $args{'dependencies'};
my $list = [];
# Principal
@@ -151,9 +151,9 @@
if ( $obj && defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related ACL equivalence Group object";
}
@@ -163,18 +163,18 @@
if ( $obj && defined $obj->id ) {
push( @$list, $obj );
} else {
- my $rec = $args{'Shredder'}->get_record( object => $self );
+ my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
- $rec->{'State'} |= INVALID;
+ $rec->{'state'} |= INVALID;
$rec->{'description'}
= "Have no related Principal #" . $self->id . " object";
}
$deps->_push_dependencies(
base_object => $self,
- Flags => RELATES,
+ flags => RELATES,
target_objects => $list,
- Shredder => $args{'Shredder'}
+ shredder => $args{'shredder'}
);
return $self->SUPER::__Relates(%args);
}
Modified: rt/branches/3.999-DANGEROUS/t/shredder/02queue.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/shredder/02queue.t (original)
+++ rt/branches/3.999-DANGEROUS/t/shredder/02queue.t Thu Jan 31 22:31:48 2008
@@ -57,7 +57,7 @@
($id, $msg) = $template->create(
name => 'my template',
queue => $queue->id,
- Content => "\nsome content",
+ content => "\nsome content",
);
ok($id, 'Created template') or diag "error: $msg";
Modified: rt/branches/3.999-DANGEROUS/t/shredder/02template.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/shredder/02template.t (original)
+++ rt/branches/3.999-DANGEROUS/t/shredder/02template.t Thu Jan 31 22:31:48 2008
@@ -16,7 +16,7 @@
my $template = RT::Model::Template->new(current_user => RT->system_user );
my ($id, $msg) = $template->create(
name => 'my template',
- Content => "\nsome content",
+ content => "\nsome content",
);
ok($id, 'Created template') or diag "error: $msg";
@@ -33,7 +33,7 @@
my ($id, $msg) = $template->create(
name => 'my template',
queue => 'General',
- Content => "\nsome content",
+ content => "\nsome content",
);
ok($id, 'Created template') or diag "error: $msg";
@@ -50,7 +50,7 @@
my ($id, $msg) = $template->create(
name => 'my template',
queue => 'General',
- Content => "\nsome content",
+ content => "\nsome content",
);
ok($id, 'Created template') or diag "error: $msg";
Modified: rt/branches/3.999-DANGEROUS/t/shredder/02user.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/shredder/02user.t (original)
+++ rt/branches/3.999-DANGEROUS/t/shredder/02user.t Thu Jan 31 22:31:48 2008
@@ -40,7 +40,7 @@
}
};
my $shredder = shredder_new();
- $shredder->put_resolver( baseClass => 'RT::Model::User', Code => $resolver );
+ $shredder->put_resolver( base_class => 'RT::Model::User', code => $resolver );
$shredder->wipeout( object => $user );
cmp_deeply( dump_current_and_savepoint('bucreate'), "current DB equal to savepoint");
}
Modified: rt/branches/3.999-DANGEROUS/t/shredder/03plugin_tickets.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/shredder/03plugin_tickets.t (original)
+++ rt/branches/3.999-DANGEROUS/t/shredder/03plugin_tickets.t Thu Jan 31 22:31:48 2008
@@ -28,7 +28,7 @@
ok( $pid, "Created new ticket" );
my $child = RT::Model::Ticket->new(current_user => RT->system_user );
- my ($cid) = $child->create( subject => 'child', queue => 1, MemberOf => $pid );
+ my ($cid) = $child->create( subject => 'child', queue => 1, member_of => $pid );
ok( $cid, "Created new ticket" );
my $plugin = RT::Shredder::Plugin::Tickets->new;
@@ -67,7 +67,7 @@
ok( $pid, "Created new ticket" );
my $child = RT::Model::Ticket->new(current_user => RT->system_user );
- my ($cid) = $child->create( subject => 'child', queue => 1, MemberOf => $pid );
+ my ($cid) = $child->create( subject => 'child', queue => 1, member_of => $pid );
ok( $cid, "Created new ticket" );
my ($status, $msg) = $child->add_link( target => $pid, type => 'DependsOn' );
@@ -105,14 +105,14 @@
{ # create parent and child and check functionality of 'apply_query_to_linked' arg
my $parent = RT::Model::Ticket->new(current_user => RT->system_user );
- my ($pid) = $parent->create( subject => 'parent', queue => 1, Status => 'resolved' );
+ my ($pid) = $parent->create( subject => 'parent', queue => 1, status => 'resolved' );
ok( $pid, "Created new ticket" );
my $child1 = RT::Model::Ticket->new(current_user => RT->system_user );
- my ($cid1) = $child1->create( subject => 'child', queue => 1, MemberOf => $pid );
+ my ($cid1) = $child1->create( subject => 'child', queue => 1, member_of => $pid );
ok( $cid1, "Created new ticket" );
my $child2 = RT::Model::Ticket->new(current_user => RT->system_user );
- my ($cid2) = $child2->create( subject => 'child', queue => 1, MemberOf => $pid, Status => 'resolved' );
+ my ($cid2) = $child2->create( subject => 'child', queue => 1, member_of => $pid, status => 'resolved' );
ok( $cid2, "Created new ticket" );
my $plugin = RT::Shredder::Plugin::Tickets->new;
Modified: rt/branches/3.999-DANGEROUS/t/shredder/utils.pl
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/shredder/utils.pl (original)
+++ rt/branches/3.999-DANGEROUS/t/shredder/utils.pl Thu Jan 31 22:31:48 2008
@@ -171,7 +171,7 @@
my $file = File::Spec->catfile( tmpdir(), test_name() .'.XXXX.sql' );
$obj->add_dump_plugin( Arguments => {
- file_name => $file,
+ filename => $file,
from_storage => 0,
} );
More information about the Rt-commit
mailing list