[Moose-commits] r7298 - in File-Stat-Moose/trunk: . lib/File/Stat t/tlib/File/Stat

dexter at code2.0beta.co.uk dexter at code2.0beta.co.uk
Mon Jan 12 21:47:55 GMT 2009


Author: dexter
Date: 2009-01-12 13:47:55 -0800 (Mon, 12 Jan 2009)
New Revision: 7298

Modified:
   File-Stat-Moose/trunk/Changes
   File-Stat-Moose/trunk/Incompatibilities
   File-Stat-Moose/trunk/lib/File/Stat/Moose.pm
   File-Stat-Moose/trunk/t/tlib/File/Stat/MooseTest.pm
Log:
* Rename back method "update" to "stat".

Modified: File-Stat-Moose/trunk/Changes
===================================================================
--- File-Stat-Moose/trunk/Changes	2009-01-12 17:31:58 UTC (rev 7297)
+++ File-Stat-Moose/trunk/Changes	2009-01-12 21:47:55 UTC (rev 7298)
@@ -4,8 +4,9 @@
 Changes:
 
 * File::Stat::Moose:
-  * New method "update".
-  * Methods "stat" and "lstat" are deprecared.
+  * Method "stat" handles "CORE::stat" and "CORE::lstat" depends on "follow"
+    attribute.
+  * Method "lstat" are deprecared.
   * Attribute "file" is required.
   * All attributes are "ro".
   * New attribute "spec" contains the class name of File::Spec class.

Modified: File-Stat-Moose/trunk/Incompatibilities
===================================================================
--- File-Stat-Moose/trunk/Incompatibilities	2009-01-12 17:31:58 UTC (rev 7297)
+++ File-Stat-Moose/trunk/Incompatibilities	2009-01-12 21:47:55 UTC (rev 7298)
@@ -1,7 +1,7 @@
 ------------------------------------------------------------------------
 0.04 -> 0.05
 
-* Methods "stat" and "lstat" are deprecared.
+* Method "lstat" are deprecared.
   Attribute "file" is required.
   All attributes are "ro".
 
@@ -9,7 +9,7 @@
 
   my $st = File::Stat::Moose->new;
   $st->file( "/etc/passwd" );
-  $st->stat;
+  $st->lstat;
 
   Should be:
 

Modified: File-Stat-Moose/trunk/lib/File/Stat/Moose.pm
===================================================================
--- File-Stat-Moose/trunk/lib/File/Stat/Moose.pm	2009-01-12 17:31:58 UTC (rev 7297)
+++ File-Stat-Moose/trunk/lib/File/Stat/Moose.pm	2009-01-12 21:47:55 UTC (rev 7298)
@@ -164,16 +164,16 @@
     assert_not_null($self->{file}) if ASSERT;
 
     # Update stat info
-    $self->update;
+    $self->stat;
 
     return TRUE;
 };
 
 
 # Call stat or lstat method
-sub update {
+sub stat {
     my $self = shift;
-    Exception::Argument->throw( message => 'Usage: $st->update()' ) if @_ > 0 or not blessed $self;
+    Exception::Argument->throw( message => 'Usage: $st->stat()' ) if @_ > 0 or not blessed $self;
 
     assert_not_null($self->{file}) if ASSERT;
 
@@ -206,28 +206,15 @@
 
 
 # Deprecated
-sub stat {
-    my ($self) = @_;
-
-    ## no critic (RequireCarping)
-    warn "Method (File::Stat::Moose->stat) is deprecated. Use constructor (new) and method (update) instead";
-
-    confess "Cannot call method (File::Stat::Moose->stat) attribute (follow) attribute is true value" if $self->follow;
-
-    return $self->update;
-};
-
-
-# Deprecated
 sub lstat {
     my ($self) = @_;
 
     ## no critic (RequireCarping)
-    warn "Method (File::Stat::Moose->lstat) is deprecated. Use constructor (new) and method (update) instead";
+    warn "Method (File::Stat::Moose->lstat) is deprecated. Use method (stat).";
 
-    confess "Cannot call method (File::Stat::Moose->lstat) attribute (follow) attribute is false value" if not $self->follow;
+    confess "Cannot call method (File::Stat::Moose->lstat) with attribute (follow) set to false value" if not $self->follow;
 
-    return $self->update;
+    return $self->stat;
 };
 
 
@@ -287,7 +274,7 @@
  #_ctime_epoch : Maybe[Int] {ro}
  ----------------------------------------------------------------------------------------
  +update() : Self
- <<deprecated>> +stat() : Self
+ +stat() : Self
  <<deprecated>> +lstat() : Self
  <<utility>> +stat( file : Str|ArrayRef[Str]|FileHandle|CacheFileHandle|OpenHandle = $_ ) : Self|Array
  <<utility>> +lstat( file : Str|ArrayRef[Str]|FileHandle|CacheFileHandle|OpenHandle = $_ ) : Self|Array
@@ -459,7 +446,7 @@
 
 =over
 
-=item update(I<>) : Self
+=item stat(I<>) : Self
 
 Updates all attributes which represent status of file.
 

Modified: File-Stat-Moose/trunk/t/tlib/File/Stat/MooseTest.pm
===================================================================
--- File-Stat-Moose/trunk/t/tlib/File/Stat/MooseTest.pm	2009-01-12 17:31:58 UTC (rev 7297)
+++ File-Stat-Moose/trunk/t/tlib/File/Stat/MooseTest.pm	2009-01-12 21:47:55 UTC (rev 7298)
@@ -142,7 +142,7 @@
     assert_not_equals(0, $obj->[7]);
 };
 
-sub test_update {
+sub test_stat {
     my $file = File::Temp->new;
     assert_isa('File::Temp', $file);
     $file->autoflush(1);
@@ -153,19 +153,19 @@
 
     $file->print(2);
 
-    $obj->update;
+    $obj->stat;
     assert_equals(2, $obj->size);
 };
 
-sub test_update_error_args {
+sub test_stat_error_args {
     my $obj = File::Stat::Moose->new( file => $file );
 
     assert_raises( ['Exception::Argument'], sub {
-        File::Stat::Moose->update;
+        File::Stat::Moose->stat;
     } );
 
     assert_raises( ['Exception::Argument'], sub {
-        $obj->update(1);
+        $obj->stat(1);
     } );
 };
 




More information about the Moose-commits mailing list