blib/lib/Keystone/Resolver/plugins/ServiceType/bookstore.pm untested

filter: Statementstmt 0.0% 0 / 13 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 32 CC 2 SCAR 13.9
CC
2
Cov
0%
handle
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 # $Id: bookstore.pm,v 1.2 2007-01-26 13:53:49 mike Exp $
2  
3 package Keystone::Resolver::plugins::ServiceType::bookstore;
4  
5 use strict;
6 use warnings;
7  
8  
9 sub handle {
10 my $class = shift();
11 my($openURL, $service) = @_;
12  
13 # A clever handler for books would use a Z39.50 server such as
14 # z3950.loc.gov:7090/Voyager to discover the ISBN of books for
15 # which none is provided. That's what I did, by hand, to discover
16 # the ISBN used in the following hideous hack.
17  
18 ### Terrible cheating to make the OpenURL 1.0 test suite work
19 my $title = $openURL->rft("btitle");
20 my $aulast = $openURL->rft("aulast");
21 if (defined $title && defined $aulast &&
22 $title =~ /^D.*sentationen syntaxe$/ && $aulast eq "Vergnaud") {
23 $openURL->descriptor("rft")->push_metadata(isbn => "9027231141");
24 }
25  
26 return $openURL->_makeURI($service->url_recipe());
27 }
28  
29  
30 1;