Evo/Fs/Stat.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 41 SCAR 6.9
CC
1
Cov
0%
is_file
2.0
is_dir
2.0
can_read
2.0
CRAP 2.0
1 package Evo::Fs::Stat;
2 use Evo -Class, 'Fcntl :mode';
3 use File::stat();
4  
5 has 'dev';
6 has 'ino';
7 has 'mode';
8 has 'nlink';
9 has 'uid';
10 has 'gid';
11 has 'rdev';
12 has 'size';
13 has 'atime';
14 has 'mtime';
15 has 'ctime';
16 has 'blksize';
17 has 'blocks';
18 has '_data';
19  
20 sub is_file($self) { S_ISREG($self->mode) }
21 sub is_dir($self) { S_ISDIR($self->mode) }
22  
23  
24 sub can_read($self) {
25 File::stat::stat_cando($self->_data, S_IRUSR);
26 }
27  
28 sub can_write($self) {
29 File::stat::stat_cando($self->_data, S_IWUSR);
30 }
31  
32 sub can_exec($self) {
33 File::stat::stat_cando($self->_data, S_IXUSR);
34 }
35  
36 sub perms($self) { $self->mode & oct(7777) }
37  
38 1;
39  
40 __END__