blib/lib/Dist/Metadata/Tar.pm

filter: Statementstmt 100% 31 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 75.0% 3 / 4 totaltotal 97.7% 43 / 44 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Dist/Metadata/Zip.pm ↑ Summary corpus/structs.pl »
1 # vim: set ts=2 sts=2 sw=2 expandtab smarttab:
2 #
3 # This file is part of Dist-Metadata
4 #
5 # This software is copyright (c) 2011 by Randy Stauner.
6 #
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 #
10 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 package Dist::Metadata::Tar;
14 5 our $AUTHORITY = 'cpan:RWSTAUNER';
15 # ABSTRACT: Enable Dist::Metadata for tar files
16 5 $Dist::Metadata::Tar::VERSION = '0.927';
17 5 ▶use Archive::Tar 1 (); # 0.07 isn't good enough
Subroutine BEGIN: called CC=1 SCAR=0.0
18 5 ▶use Carp (); # core
Subroutine BEGIN: called CC=1 SCAR=0.0
19 5 ▶use parent 'Dist::Metadata::Archive';
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 5 push(@Dist::Metadata::CARP_NOT, __PACKAGE__);
22  
23 23 ▶sub file_content {
Subroutine file_content: called CC=1 SCAR=0.0
Pod documented
24 23 my ( $self, $file ) = @_;
25 23 return $self->archive->get_content( $self->full_path($file) );
26 }
27  
28 11 ▶sub find_files {
Subroutine find_files: called CC=1 SCAR=0.0
Pod documented
29 11 my ($self) = @_;
30 return
31 35 map { $_->full_path }
32 11 grep { $_->is_file }
33 $self->archive->get_files;
34 }
35  
36 12 ▶sub read_archive {
Subroutine read_archive: called CC=1 SCAR=0.0
Pod documented
37 12 my ($self, $file) = @_;
38  
39 12 my $archive = Archive::Tar->new();
40 12 $archive->read($file);
41  
42 12 return $archive;
43 }
44  
45 1 ▶sub tar {
Subroutine tar: called CC=1 SCAR=0.0
Pod undocumented
46 1 warn __PACKAGE__ . '::tar() is deprecated. Use archive() instead.';
47 1 return $_[0]->archive;
48 }
49  
50 5 1;
51  
52 __END__
« blib/lib/Dist/Metadata/Zip.pm ↑ Summary corpus/structs.pl »