File Coverage

blib/lib/Email/Send/IO.pm
Criterion Covered Total %
statement 27 27 100.0
branch 4 8 50.0
condition n/a
subroutine 7 7 100.0
pod 0 2 0.0
total 38 44 86.3


line stmt bran cond sub pod time code
1             package Email::Send::IO;
2 1     1   4195 use strict;
  1         2  
  1         113  
3              
4             BEGIN {
5 1     1   2 local $Return::Value::NO_CLUCK = 1;
6 1         5 require Return::Value;
7 1         58 Return::Value->import;
8             }
9              
10 1     1   5 use vars qw[$VERSION];
  1         2  
  1         48  
11             $VERSION = '2.201';
12              
13 1     1   4 use vars qw[@IO];
  1         1  
  1         112  
14             @IO = ('=') unless @IO;
15              
16             sub is_available {
17 3 50   3 0 37134 return eval { require IO::All }
  3         772  
18             ? success
19             : failure "is_available: Loading IO::All failed: $@";
20             }
21              
22             sub send {
23 2     2 0 254 my ($class, $message, @args) = @_;
24 1     1   4 eval { no warnings 'redefine'; require IO::All; IO::All->import };
  1         2  
  1         152  
  2         5  
  2         9  
  2         17  
25 2 50       96 return failure "send: Loading IO::All failed: $@" if $@;
26 2 50       12 @args = (@IO) unless @args;
27 2         4 eval { io(@args)->append($message->as_string) };
  2         7  
28 2 50       9419 return failure $@ if $@;
29 2         240 return success;
30             }
31              
32             1;
33              
34             __END__