| 1 | package Logfile::EPrints::Mapping::EPrints; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 4 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 7 | 4 | my ($class,%self) = @_; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 4 | ▶ | Carp::croak(__PACKAGE__." requires identifier argument") unless exists $self{identifier}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 4 | bless \%self, $class; | |||||||||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 1146 | ▶ | sub hit { | ||||||||||||||||||||||||||
|
Subroutine
hit: called CC=7 SCAR=19.5
Pod
undocumented
| |||||||||||||||||||||||||||||
| 15 | 1146 | my ($self,$hit) = @_; | |||||||||||||||||||||||||||
| 16 | 1146 | ▶ | if( 'GET' eq $hit->method && 200 == $hit->code ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
"GET" eq $hit->method and 200 == $hit->code
MC/DC100%2/2
"GET" eq $hit->method and 200 == $hit->code
"GET" eq $hit->method
200 == $hit->code
Truth table100%3/3
A and B
A= "GET" eq $hit->methodB= 200 == $hit->code
| |||||||||||||||||||||||||||||
| 17 | 725 | my $path = URI->new($hit->page,'http')->path; | |||||||||||||||||||||||||||
| 18 | # Full text | ||||||||||||||||||||||||||||
| 19 | 725 | ▶ | if( $path =~ /^(?:\/archive)?\/(\d+)\/\d/ ) { | ||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||
| 20 | 64 | $hit->{identifier} = $self->_identifier($1); | |||||||||||||||||||||||||||
| 21 | 64 | $self->{handler}->fulltext($hit); | |||||||||||||||||||||||||||
| 22 | } elsif( $path =~ /^(?:\/archive)?\/(\d+)\/?$/ ) { | ||||||||||||||||||||||||||||
| 23 | 154 | $hit->{identifier} = $self->_identifier($1); | |||||||||||||||||||||||||||
| 24 | 154 | $self->{handler}->abstract($hit); | |||||||||||||||||||||||||||
| 25 | } elsif( $path =~ /^\/view\/(\w+)\// ) { | ||||||||||||||||||||||||||||
| 26 | 197 | $hit->{section} = $1; | |||||||||||||||||||||||||||
| 27 | 197 | $self->{handler}->browse($hit); | |||||||||||||||||||||||||||
| 28 | } elsif( $path =~ /^\/perl\/search/ ) { | ||||||||||||||||||||||||||||
| 29 | 10 | $self->{handler}->search($hit); | |||||||||||||||||||||||||||
| 30 | } else { | ||||||||||||||||||||||||||||
| 31 | #warn "Unknown path = ", $uri->path, "\n"; | ||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 218 | ▶ | sub _identifier { | ||||||||||||||||||||||||||
|
Subroutine
_identifier: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 37 | 218 | my ($self,$no) = @_; | |||||||||||||||||||||||||||
| 38 | 218 | return $self->{'identifier'}.($no+0); | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | # Autoload methods go after =cut, and are processed by the autosplit program. | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 6 | 1; | |||||||||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||||||||||