Rubric/CLI/Command/linkcheck.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 37 CC 3 SCAR 17.5
CC
3
Cov
0%
run
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 5.8
1 use strict;
2 use warnings;
3 package Rubric::CLI::Command::linkcheck 0.157;
4 # ABSTRACT: check validity of links in the database
5  
6 use parent qw(Rubric::CLI::Command);
7  
8 use LWP::Simple ();
9 use Rubric::DBI::Setup;
10  
11 sub run {
12 my ($self, $opt, $args) = @_;
13  
14 my $links = Rubric::Link->retrieve_all;
15  
16 while (my $link = $links->next) {
17 my $uri = $link->uri;
18 if ($uri->scheme ne 'http') {
19 print "unknown scheme on link $link\n";
20 next;
21 }
22  
23 unless (LWP::Simple::head($uri)) {
24 print "couldn't get headers for $uri\n";
25 }
26 }
27 }
28  
29 1;
30  
31 __END__