| 1 | package VCS::Rcs::Dir; | ||
| 2 | |||
| 3 | use Carp; | ||
| 4 | |||
| 5 | @ISA = qw(VCS::Rcs VCS::Dir); | ||
| 6 | |||
| 7 | use strict; | ||
| 8 | |||
| 9 | sub new { | ||
| 10 | my($class, $url) = @_; | ||
| 11 | my $self = $class->init($url); | ||
| 12 | my $path = $self->path; | ||
| 13 | die "$class->new: $path: $!\n" unless -d $path; | ||
| 14 | die "$class->new: $path not an RCS directory: $!\n" | ||
| 15 | unless -d $path . 'RCS' or glob "$path*,v"; | ||
| 16 | $self; | ||
| 17 | } | ||
| 18 | |||
| 19 | # evil assumption - no query string! | ||
| 20 | sub content { | ||
| 21 | my $self = shift; | ||
| 22 | my $base_dir = $self->path; | ||
| 23 | sort map { | ||
| 24 | my $new_class = -d "$base_dir$_" ? 'VCS::Rcs::Dir' : 'VCS::Rcs::File'; | ||
| 25 | $new_class->new($self->url . $_); | ||
| 26 | } grep { | ||
| 27 | (!/^RCS$/) && (-f "$base_dir$_" || -d "$base_dir$_") | ||
| 28 | } $self->read_dir($base_dir); | ||
| 29 | } | ||
| 30 | |||
| 31 | 1; |