Algorithm-Diff-HTMLTable
view release on metacpan or search on metacpan
MANIFEST
META.json
META.yml
Makefile.PL
README
dist.ini
lib/Algorithm/Diff/HTMLTable.pm
t/01_base.t
t/02_id.t
t/03_encoding.t
t/04_eol.t
t/05_arrayrefs.t
t/06_title.t
t/07_html.t
t/08_add_tablerow.t
t/09_read_file.t
t/10_diff.t
t/author-pod-coverage.t
t/author-pod-syntax.t
t/files/01_a.txt
t/files/01_b.txt
id => 'diff_table',
encoding => 'utf8',
);
Available options:
* id
* encoding
* eol
diff
$diff = $builder->diff( $sourcefile, $targetfile );
AUTHOR
Renee Baecker <reneeb@cpan.org>
COPYRIGHT AND LICENSE
lib/Algorithm/Diff/HTMLTable.pm view on Meta::CPAN
}
return if !-r $file;
my @lines;
open my $fh, '<', $file;
if ( $self->{encoding} ) {
binmode $fh, ':encoding(' . $self->{encoding} . ')';
}
local $/ = $self->{eol} // "\n";
@lines = <$fh>;
close $fh;
return @lines;
}
1;
__END__
lib/Algorithm/Diff/HTMLTable.pm view on Meta::CPAN
);
Available options:
=over 4
=item * id
=item * encoding
=item * eol
=back
=head2 diff
$diff = $builder->diff( $sourcefile, $targetfile );
=head1 AUTHOR
Renee Baecker <reneeb@cpan.org>
use warnings;
use Test::More;
use Test::LongString;
use File::Basename;
use File::Spec;
use Algorithm::Diff::HTMLTable;
my @files = map{ File::Spec->catfile( dirname( __FILE__ ), 'files', "04_$_.txt" ) }qw/a b/;
my $diff = Algorithm::Diff::HTMLTable->new( id => 'test_id', eol => "---\n" );
my $html = $diff->diff( @files );
my $check = do{ local $/; <DATA> };
chomp $check;
$check =~ s{__files0__}{$files[0]};
$check =~ s{__files1__}{$files[1]};
$check =~ s{\\}{\\\\}g;
( run in 0.720 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )