HiD/Server/Handler.pm

filter: Statementstmt 47.8% 11 / 23 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 43.2% 16 / 37 CC 3 SCAR 17.7
CC
3
Cov
39%
new
12.0
republish
2.0
BEGIN
1.0
CRAP 5.9
« HiD/Server/Loader.pm ↑ Summary HiD/Processor/IIBlog.pm »
1 # ABSTRACT: Helper for 'hid publish -A'
2  
3  
4 package HiD::Server::Handler;
5 6 our $AUTHORITY = 'cpan:GENEHACK';
6 6 $HiD::Server::Handler::VERSION = '1.96';
7 6 ▶use 5.014; # strict, unicode_strings
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 6 ▶use parent 'Plack::Handler::Standalone';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13 sub new {
14 0 ▶ my( $class , %args ) = @_;
Subroutine new: not called CC=3 SCAR=24.8
Pod documented
15  
16 0 my $hid = delete $args{hid};
17  
18 0 ▶ die "I must be passed something that can('publish') not a '$hid'!\n"
Branch: 1 branch
BranchTrueFalseTotal
unless defined $hid and $hid->can("publish") 0 0 0
Condition0%0/3
defined $hid and $hid->can("publish")
!ll&&!rl&&r
000
MC/DC0%0/2
defined $hid and $hid->can("publish")
defined $hid $hid->can("publish")
Truth table0%0/3
A and B
A= defined $hidB= $hid->can("publish")
ABresult
0X0
100
111
19 unless defined $hid and $hid->can('publish');
20  
21 0 my $self = $class->SUPER::new(%args);
22  
23 0 $self->{__hid__} = $hid;
24  
25 0 return $self;
26  
27 }
28  
29  
30 sub republish {
31 0 ▶ my $self = shift;
Subroutine republish: not called CC=1 SCAR=6.9
Pod documented
32  
33 0 my $hid = $self->{__hid__};
34  
35 0 $hid->reset_hid();
36  
37 # FIXME eeeeevvvviillll
38 0 $hid->config(); # force builder to fire
39 0 $hid->{hid}{config}{clean_destination} = 1; # get up in them guts
40  
41 0 $hid->publish();
42 }
43  
44 6 1;
45  
46 __END__
47  
48 =pod
49  
50 =encoding UTF-8
51  
52 =head1 NAME
53  
54 HiD::Server::Handler - Helper for 'hid publish -A'
55  
56 =head1 METHODS
57  
58 =head2 new
59  
60 Constructor.
61  
62 =head2 republish
63  
64 Handles resetting the embedded L<HiD> object and calling the C<publish> method
65 on it.
66  
67 =head1
68  
69 Helper for C<hid publish -A>
70  
71 =head1 VERSION
72  
73 version 1.96
74  
75 =head1 AUTHOR
76  
77 John SJ Anderson <genehack@genehack.org>
78  
79 =head1 COPYRIGHT AND LICENSE
80  
81 This software is copyright (c) 2015 by John SJ Anderson.
82  
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85  
86 =cut
« HiD/Server/Loader.pm ↑ Summary HiD/Processor/IIBlog.pm »