blib/lib/Punk/AsyncAwait.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 27 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Punk.pm ↑ Summary blib/lib/Punk/Auth.pm »
1 package Punk::AsyncAwait;
2  
3 # Future::AsyncAwait needs 5.16; Punk itself claims 5.10. Nothing in Punk
4 # loads this module, so a 5.10 perl installs and runs Punk exactly as before
5 # and only an application that asks for the keywords pays the higher floor.
6 2 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 our $VERSION = '0.70';
11  
12 2 ▶use Punk::Future (); # the AWAIT_* methods live in Punk's XS, and a
Subroutine BEGIN: called CC=1 SCAR=0.0
13 # controller may never have loaded Punk itself
14 2 ▶use Future::AsyncAwait ();
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 # `async` and `await` are parser keywords, not subs - they need a real keyword
17 # plugin, which is what Future::AsyncAwait installs through the lexical hints
18 # hash. Forwarding its import from ours installs them into whatever scope is
19 # compiling when the `use` line is reached, which is the caller's file.
20 #
21 # The default future class goes first so a caller's own choice wins: the hint
22 # is assigned once per occurrence, last one through.
23 6 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
24 6 my $class = shift;
25 6 Future::AsyncAwait->import( future_class => 'Punk::Future', @_ );
26 }
27  
28 1 ▶sub unimport {
Subroutine unimport: called CC=1 SCAR=0.0
29 1 my $class = shift;
30 1 Future::AsyncAwait->unimport(@_);
31 }
32  
33 2 1;
34  
35 __END__
« blib/lib/Punk.pm ↑ Summary blib/lib/Punk/Auth.pm »