| 1 | package File::Find::Rule::ConflictMarker; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use parent qw/File::Find::Rule/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | our $VERSION = '0.01'; | |||||||||
| 7 | |||||||||||
| 8 | 2 | my $CONFLICT_MARKER_BASE = '<' x 7; | |||||||||
| 9 | 2 | my $CONFLICT_MARKER_DEVIDER = '=' x 7; | |||||||||
| 10 | 2 | my $CONFLICT_MARKER_TARGET = '>' x 7; | |||||||||
| 11 | 2 | my $CONFLICT_MARKER_SOURCE = '|' x 7; | |||||||||
| 12 | |||||||||||
| 13 | 2 | my $CONFLICT_MARKER_COND = join '|', map { "\Q$_\E" } ( | |||||||||
| 14 | $CONFLICT_MARKER_BASE, | ||||||||||
| 15 | $CONFLICT_MARKER_DEVIDER, | ||||||||||
| 16 | $CONFLICT_MARKER_TARGET, | ||||||||||
| 17 | $CONFLICT_MARKER_SOURCE, | ||||||||||
| 18 | ); | ||||||||||
| 19 | |||||||||||
| 20 | 2 | our $CONFLICT_MARKER_REGEX = qr/($CONFLICT_MARKER_COND)/; | |||||||||
| 21 | |||||||||||
| 22 | sub File::Find::Rule::conflict_marker { | ||||||||||
| 23 | 1 | ▶ | my ($file_find_rule) = @_; | ||||||||
|
Subroutine
conflict_marker: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 24 | |||||||||||
| 25 | 1 | my $self = $file_find_rule->_force_object; | |||||||||
| 26 | |||||||||||
| 27 | return $self->file->exec(sub{ | ||||||||||
| 28 | 7 | ▶ | my ($file) = @_; | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.0
| |||||||||||
| 29 | |||||||||||
| 30 | 7 | ▶ | open my $fh, '<', $file or die "Could not open $file, $!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 7 | my $content = do { local $/; <$fh>; }; | |||||||||
| 32 | 7 | close $fh; | |||||||||
| 33 | |||||||||||
| 34 | 7 | return $content =~ m!$CONFLICT_MARKER_REGEX!; | |||||||||
| 35 | 1 | }); | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 2 | 1; | |||||||||
| 39 | |||||||||||
| 40 | __END__ | ||||||||||