File Coverage

blib/lib/Metabrik/System/Gphotofs.pm
Criterion Covered Total %
statement 9 26 34.6
branch 0 8 0.0
condition 0 6 0.0
subroutine 3 6 50.0
pod 1 3 33.3
total 13 49 26.5


line stmt bran cond sub pod time code
1             #
2             # $Id$
3             #
4             # system::gphotofs Brik
5             #
6             package Metabrik::System::Gphotofs;
7 1     1   733 use strict;
  1         3  
  1         29  
8 1     1   6 use warnings;
  1         2  
  1         28  
9              
10 1     1   4 use base qw(Metabrik::Shell::Command Metabrik::System::Package);
  1         2  
  1         435  
11              
12             sub brik_properties {
13             return {
14 0     0 1   revision => '$Revision$',
15             tags => [ qw(unstable mtp mtpfs mount umount fs filesystem) ],
16             author => 'GomoR ',
17             license => 'http://opensource.org/licenses/BSD-3-Clause',
18             attributes => {
19             mount_point => [ qw(directory) ],
20             },
21             attributes_default => {
22             },
23             commands => {
24             install => [ ], # Inherited
25             mount => [ qw(mount_point|OPTIONAL) ],
26             umount => [ qw(mount_point|OPTIONAL) ],
27             },
28             require_binaries => {
29             gphotofs => [ ],
30             fusermount => [ ],
31             },
32             need_packages => {
33             ubuntu => [ qw(gphotofs fuse) ],
34             debian => [ qw(gphotofs fuse) ],
35             kali => [ qw(gphotofs fuse) ],
36             },
37             };
38             }
39              
40             sub mount {
41 0     0 0   my $self = shift;
42 0           my ($mount_point) = @_;
43              
44 0   0       $mount_point ||= $self->mount_point;
45 0 0         $self->brik_help_run_undef_arg('mount', $mount_point) or return;
46 0 0         $self->brik_help_run_directory_not_found('mount', $mount_point) or return;
47              
48 0           my $cmd = 'gphotofs "'.$mount_point.'" -o allow_other';
49              
50 0           $self->use_sudo(1);
51              
52 0           return $self->execute($cmd);
53             }
54              
55             sub umount {
56 0     0 0   my $self = shift;
57 0           my ($mount_point) = @_;
58              
59 0   0       $mount_point ||= $self->mount_point;
60 0 0         $self->brik_help_run_undef_arg('umount', $mount_point) or return;
61 0 0         $self->brik_help_run_directory_not_found('umount', $mount_point) or return;
62              
63 0           my $cmd = 'fusermount -u "'.$mount_point.'"';
64              
65 0           $self->use_sudo(1);
66              
67 0           return $self->execute($cmd);
68             }
69              
70             1;
71              
72             __END__