| 1 | package POE::Component::DirWatch::Modified; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use POE; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | our $VERSION = "0.300002"; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 2 | extends 'POE::Component::DirWatch'; | |||||||||||||||||||||||||||
| 9 | 2 | with 'POE::Component::DirWatch::Role::Signatures'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | #--------#---------#---------#---------#---------#---------#---------#--------- | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | around '_file_callback' => sub { | ||||||||||||||||||||||||||||
| 14 | 8 | ▶ | my $orig = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 15 | 8 | my ($self, $file) = @_[OBJECT, ARG0]; | |||||||||||||||||||||||||||
| 16 | 8 | my $sigs = $self->signatures; | |||||||||||||||||||||||||||
| 17 | 8 | my $new_sig = $self->_generate_signature($file); | |||||||||||||||||||||||||||
| 18 | 8 | ▶ | return if exists $sigs->{"$file"} && $sigs->{"$file"} eq $new_sig; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
exists $$sigs{"$file"} and $$sigs{"$file"} eq $new_sig
MC/DC100%2/2
exists $$sigs{"$file"} and $$sigs{"$file"} eq $new_sig
exists $$sigs{"$file"}
$$sigs{"$file"} eq $new_sig
Truth table100%3/3
A and B
A= exists $$sigs{"$file"}B= $$sigs{"$file"} eq $new_sig
| |||||||||||||||||||||||||||||
| 19 | 3 | $sigs->{"$file"} = $new_sig; | |||||||||||||||||||||||||||
| 20 | 3 | return $orig->(@_); | |||||||||||||||||||||||||||
| 21 | 2 | }; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 2 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 2 | 1; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | __END__; | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | #--------#---------#---------#---------#---------#---------#---------#--------- | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | =head1 NAME | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | POE::Component::DirWatch::Modified | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | POE::Component::DirWatch::Modified extends DirWatch::New in order to exclude | ||||||||||||||||||||||||||||
| 39 | files that have already been seen, but still pick up files that have been | ||||||||||||||||||||||||||||
| 40 | changed. Usage is identical to L<POE::Component::DirWatch>. | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | This module consumes the L<POE::Component::DirWatch::Role::Signatures> role, | ||||||||||||||||||||||||||||
| 43 | please see its documentation for information about methods or attributes | ||||||||||||||||||||||||||||
| 44 | it provides or extends. | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | =head1 METHODS | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | =head2 _file_callback | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | C<override '_file_callback'> Don't call the callback if file has been seen | ||||||||||||||||||||||||||||
| 51 | before and is unchanged. | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | =head2 meta | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | See L<Moose> | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | L<POE::Component::DirWatch::New>, L<POE::Component::DirWatch> | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | Copyright 2006-2008 Guillermo Roditi. This is free software; you may | ||||||||||||||||||||||||||||
| 64 | redistribute it and/or modify it under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | =cut | ||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||