Anonymous avatar Anonymous committed 15e398e

Moved all common accessors into a common base class, and added the inode()
accessor.

Comments (0)

Files changed (1)

lib/File/Find/Object.pm

 # This program is free software, distributed under the same terms as 
 # Parrot.
 
-package File::Find::Object::PathComponent;
+package File::Find::Object::Base;
 
 use strict;
 use warnings;
 
 use base 'Class::Accessor';
 
-use File::Spec;
-
 __PACKAGE__->mk_accessors(qw(
     _action
     _curr_file
     dir
+    _files
     idx
-    _files
-    )
-);
+    inode
+));
+
+package File::Find::Object::PathComponent;
+
+use strict;
+use warnings;
+
+use vars qw(@ISA);
+
+@ISA = (qw(File::Find::Object::Base));
+
+use File::Spec;
+
 
 sub new {
     my ($class, $top, $from, $index) = @_;
 use strict;
 use warnings;
 
-use base 'Class::Accessor';
+use vars qw(@ISA);
+
+@ISA = (qw(File::Find::Object::Base));
 
 __PACKAGE__->mk_accessors(qw(
-    _action
     _dir_stack
-    dir
-    idx
-    _curr_file
-    _files
 ));
 
 use Carp;
     }
     my $ptr = $current; my $rc;
     while($self->_father($ptr)) {
-        if($self->_father($ptr)->{inode} == $st[1] && $self->_father($ptr) == $st[0]) {
+        if($self->_father($ptr)->inode() == $st[1] && $self->_father($ptr) == $st[0]) {
             $rc = 1;
             last;
         }
     );
     closedir($handle);
     my @st = stat($current->dir());
-    $current->{inode} = $st[1];
+    $current->inode($st[1]);
     $current->{dev} = $st[0];
     return 1;
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.