line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Archive::Any::Plugin::Rar; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
73548
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
108
|
|
4
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
102
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
16
|
use base 'Archive::Any::Plugin'; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
2538
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
6786
|
use Archive::Rar; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Archive::Any::Plugin::Rar - Archive::Any wrapper around Archive::Rar |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Do not use this module directly. Instead, use Archive::Any. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub can_handle { |
26
|
|
|
|
|
|
|
return( |
27
|
|
|
|
|
|
|
'application/x-rar', |
28
|
|
|
|
|
|
|
'application/x-rar-compressed', |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub files { |
33
|
|
|
|
|
|
|
my( $self, $file ) = @_; |
34
|
|
|
|
|
|
|
my $t = Archive::Rar->new( -archive => $file ); |
35
|
|
|
|
|
|
|
$t->List(); |
36
|
|
|
|
|
|
|
map { $_->{name} } @{$t->{list}}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub extract { |
40
|
|
|
|
|
|
|
my ( $self, $file ) = @_; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $t = Archive::Rar->new( -archive => $file, -quiet => 'True' ); |
43
|
|
|
|
|
|
|
return $t->Extract; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub type { |
47
|
|
|
|
|
|
|
my $self = shift; |
48
|
|
|
|
|
|
|
return 'rar'; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SEE ALSO |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Archive::Any, Archive::Rar |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 AUTHOR |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Dmitriy V. Simonov, C<< >> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Thanks to Clint Moore for L |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Thanks to C<< >> for minor fix |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Thanks to C<< >> for major fix |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Copyright 2010 Dmitriy V. Simonov. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
72
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
73
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; # End of Archive::Any::Plugin::Rar |