lib/Zoom/Meeting.pm untested

filter: Statementstmt 0.0% 0 / 36 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 Subroutinesub 0.0% 0 / 7 totaltotal 0.0% 0 / 48 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # ABSTRACT: Launch Zoom meetings via Perl
2  
3 use v5.37.12;
4 use experimental qw( class try builtin );
5 use builtin qw( true false blessed );
6  
7 package Zoom::Meeting; # quirk
8 class Zoom::Meeting {
9  
10 use overload q("") => sub { $_[0] -> _url; };
11  
12 use URI;
13 use Path::Tiny;
14 use System::Command;
15  
16 # @formatter:off
17 field $id :param;
18 field $password :param = undef;
19 # @formatter:on
20  
21 method _url ( ) {
22 my $uri = URI -> new( 'zoommtg://zoom.us' ); # scheme is '_foreign' class, so no 'host' method
23 $uri -> path( 'join' );
24 $uri -> query_form_hash( {
25 'confno' => $id ,
26 'pwd' => $password
27 } );
28 return $uri;
29 }
30  
31 method launch ( ) {
32  
33 my $zoom;
34  
35 if ( $^O eq 'linux' and -f '/proc/sys/fs/binfmt_misc/WSLInterop' ) {
36 $zoom = path '/mnt/c/Program Files/Zoom/bin/zoom.exe';
37 }
38  
39 System::Command -> new(
40 $zoom ,
41 "--url=@{ [ $self -> _url ] }" ,
42 # { trace => 3 }
43 );
44  
45 }
46  
47 }
48  
49 __END__