[Rt-commit] rt branch, 3.999-trunk, updated. 31b377b2ad98c4187a1ac2245a171d7f5d8f5240

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sun Nov 29 21:22:00 EST 2009


The branch, 3.999-trunk has been updated
       via  31b377b2ad98c4187a1ac2245a171d7f5d8f5240 (commit)
      from  93cfd7c437c634880e4cf92093028229f9a886bb (commit)

Summary of changes:
 lib/RT/Shredder.pm                         |   34 ++++++++++++++--------------
 lib/RT/Shredder/Plugin/SQLDump.pm          |    8 +++---
 share/html/Admin/Tools/Shredder/index.html |    2 +-
 3 files changed, 22 insertions(+), 22 deletions(-)

- Log -----------------------------------------------------------------
commit 31b377b2ad98c4187a1ac2245a171d7f5d8f5240
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Nov 30 10:19:50 2009 +0800

    obra said filename is a word :)

diff --git a/lib/RT/Shredder.pm b/lib/RT/Shredder.pm
index 2bc846e..5adaf12 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -607,32 +607,32 @@ sub _wipeout {
 
 =head3 Data storage and backups
 
-=head4 get_file_name ( Filename => '<ISO DATETIME>-XXXX.sql', FromStorage => 1 )
+=head4 get_filename ( filename => '<ISO DATETIME>-XXXX.sql', from_storage => 1 )
 
-Takes desired C<Filename> and flag C<FromStorage> then translate file name to absolute
+Takes desired C<filename> and flag C<from_storage> then translate file name to absolute
 path by next rules:
 
 =over
 
 =item *
 
-Default value of the C<Filename> option is C<< <ISO DATETIME>-XXXX.sql >>;
+Default value of the C<filename> option is C<< <ISO DATETIME>-XXXX.sql >>;
 
 =item *
 
-if C<Filename> has C<XXXX> (exactly four uppercase C<X> letters) then it would be changed with digits from 0000 to 9999 range, with first one free value;
+if C<filename> has C<XXXX> (exactly four uppercase C<X> letters) then it would be changed with digits from 0000 to 9999 range, with first one free value;
 
 =item *
 
-if C<Filename> has C<%T> then it would be replaced with the current date and time in the C<YYYY-MM-DDTHH:MM:SS> format. Note that using C<%t> may still generate not unique names, using C<XXXX> recomended.
+if C<filename> has C<%T> then it would be replaced with the current date and time in the C<YYYY-MM-DDTHH:MM:SS> format. Note that using C<%t> may still generate not unique names, using C<XXXX> recomended.
 
 =item *
 
-if C<FromStorage> argument is true (default behaviour) then result path would always be relative to C<StoragePath>;
+if C<from_storage> argument is true (default behaviour) then result path would always be relative to C<StoragePath>;
 
 =item *
 
-if C<FromStorage> argument is false then result would be relative to the current dir unless it's already absolute path.
+if C<from_storage> argument is false then result would be relative to the current dir unless it's already absolute path.
 
 =back
 
@@ -640,26 +640,26 @@ Returns an absolute path of the file.
 
 Examples:
     # file from storage with default name format
-    my $fname = $shredder->get_file_name;
+    my $fname = $shredder->get_filename;
 
     # file from storage with custom name format
-    my $fname = $shredder->get_file_name( Filename => 'shredder-XXXX.backup' );
+    my $fname = $shredder->get_filename( filename => 'shredder-XXXX.backup' );
 
     # file with path relative to the current dir
-    my $fname = $shredder->get_file_name(
-        FromStorage => 0,
-        Filename => 'backups/shredder.sql',
+    my $fname = $shredder->get_filename(
+        from_storage => 0,
+        filename => 'backups/shredder.sql',
     );
 
     # file with absolute path
-    my $fname = $shredder->get_file_name(
-        FromStorage => 0,
-        Filename => '/var/backups/shredder-XXXX.sql'
+    my $fname = $shredder->get_filename(
+        from_storage => 0,
+        filename => '/var/backups/shredder-XXXX.sql'
     );
 
 =cut
 
-sub get_file_name {
+sub get_filename {
     my $self = shift;
     my %args = ( filename => '', from_storage => 1, @_ );
 
@@ -718,7 +718,7 @@ sub get_file_name {
 Returns an absolute path to the storage dir.  See
 L<CONFIGURATION/$ShredderStoragePath>.
 
-See also description of the L</get_file_name> method.
+See also description of the L</get_filename> method.
 
 =cut
 
diff --git a/lib/RT/Shredder/Plugin/SQLDump.pm b/lib/RT/Shredder/Plugin/SQLDump.pm
index a0147c9..e1c5494 100644
--- a/lib/RT/Shredder/Plugin/SQLDump.pm
+++ b/lib/RT/Shredder/Plugin/SQLDump.pm
@@ -57,15 +57,15 @@ sub applies_to_states { return 'after wiping dependencies' }
 
 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_file_name(
-        file_name     => $args{'file_name'},
+    my $file = $args{'filename'} = RT::Shredder->get_filename(
+        filename     => $args{'filename'},
         from_storage => delete $args{'from_storage'},
     );
     open $args{'file_handle'}, ">:raw", $file
@@ -74,7 +74,7 @@ sub test_args {
     return $self->SUPER::test_args(%args);
 }
 
-sub file_name    { return $_[0]->{'opt'}{'file_name'} }
+sub filename    { return $_[0]->{'opt'}{'filename'} }
 sub file_handle { return $_[0]->{'opt'}{'file_handle'} }
 
 sub run {
diff --git a/share/html/Admin/Tools/Shredder/index.html b/share/html/Admin/Tools/Shredder/index.html
index 22bab8b..838d463 100644
--- a/share/html/Admin/Tools/Shredder/index.html
+++ b/share/html/Admin/Tools/Shredder/index.html
@@ -145,7 +145,7 @@ if( $plugin && $wipeout ) { { # use additional block({}) to effectively exit blo
         last;
     }
 
-    ($dump_file) = $backup_plugin->file_name;
+    ($dump_file) = $backup_plugin->filename;
     push @{ $messages{'Success'} }, "SQL dump file is '$dump_file'";
 
     $shredder->add_dump_plugin( object => $backup_plugin );

-----------------------------------------------------------------------


More information about the Rt-commit mailing list