Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6220ce

Browse files
committed
pod updates
pod_coverage.t added updated Changes
1 parent c394171 commit a6220ce

File tree

10 files changed

+128
-3
lines changed

10 files changed

+128
-3
lines changed

Changes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
v0.92 Fri Nov 11 2005
1+
v0.92 Thu Dec 15 2005
22
- updated Catalyst plugin for Catalyst 5.5
3+
- pod updates
34

45
v0.91 Wed Oct 5 2005
56
- modified Response/SearchRetrieve.pm to

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ t/cgi.t
2323
t/cgi_app.t
2424
t/diagnostic.t
2525
t/pod.t
26+
t/pod_coverage.t
2627
t/record.t
2728
t/request_explain.t
2829
t/request_scan.t

lib/SRU/Request/Explain.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ my @validParams = qw(
5858
extraRequestData
5959
);
6060

61+
=head2 validParams()
62+
63+
=cut
64+
6165
# no pod since this is used in SRU::Request
6266
sub validParams { return @validParams };
6367

lib/SRU/Request/Scan.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ my @validParams = qw(
6161
extraRequestData
6262
);
6363

64+
=head2 validParams()
65+
66+
=cut
67+
6468
sub validParams { return @validParams; }
6569

6670
SRU::Request::Scan->mk_accessors( @validParams );

lib/SRU/Request/SearchRetrieve.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ my @validParams = qw(
7373
extraRequestData
7474
);
7575

76+
=head2 validParams()
77+
78+
=cut
79+
7680
sub validParams { return @validParams };
7781

7882
SRU::Request::SearchRetrieve->mk_accessors( @validParams );

lib/SRU/Server.pm

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ my @accessors = qw( request response cql );
7979

8080
__PACKAGE__->mk_accessors( @accessors );
8181

82+
=head1 CGI::APPLICATION METHODS
83+
84+
=head2 setup
85+
86+
Sets the C<run_modes>, C<mode_param> and the default runmode (explain).
87+
88+
=cut
89+
8290
sub setup {
8391
my $self = shift;
8492

@@ -87,6 +95,12 @@ sub setup {
8795
$self->mode_param( 'operation' );
8896
}
8997

98+
=head2 cgiapp_prerun
99+
100+
Parses the incoming SRU request and if needed, checks the CQL query.
101+
102+
=cut
103+
90104
sub cgiapp_prerun {
91105
my $self = shift;
92106
my $mode = shift;
@@ -115,6 +129,12 @@ sub cgiapp_prerun {
115129
}
116130
}
117131

132+
=head2 cgiapp_postrun
133+
134+
Sets the content type (text/xml) and serializes the response.
135+
136+
=cut
137+
118138
sub cgiapp_postrun {
119139
my $self = shift;
120140
my $output_ref = shift;
@@ -124,6 +144,12 @@ sub cgiapp_postrun {
124144
$$output_ref = $self->response->asXML;
125145
}
126146

147+
=head2 error_mode
148+
149+
Stub error runmode.
150+
151+
=cut
152+
127153
sub error_mode {
128154
}
129155

lib/SRU/Utils.pm

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ use base qw( Exporter );
66

77
our @EXPORT_OK = qw( error );
88

9+
=head1 NAME
10+
11+
SRU::Utils - Utility functions for SRU
12+
13+
=head1 SYNOPSIS
14+
15+
use SRU::Utils qw( error );
16+
return error( "error!" );
17+
18+
=head1 DESCRIPTION
19+
20+
This is a set of utility functions for the SRU objects.
21+
22+
=head1 METHODS
23+
24+
=head2 error( $message )
25+
26+
Sets the C<$SRU::Error> message.
27+
28+
=cut
29+
930
sub error {
1031
if ( $_[0] ) { $SRU::Error = $_[0]; };
1132
return;

lib/SRU/Utils/XML.pm

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,51 @@ use base qw( Exporter );
66

77
our @EXPORT_OK = qw( element elementNoEscape escape stylesheet );
88

9+
=head1 NAME
10+
11+
SRU::Utils::XML - XML utility functions for SRU
12+
13+
=head1 SYNOPSIS
14+
15+
use SRU::Utils::XML qw( escape );
16+
return escape( $text );
17+
18+
=head1 DESCRIPTION
19+
20+
This is a set of utility functions for use with XML data.
21+
22+
=head1 METHODS
23+
24+
=head2 element( $tag, $text )
25+
26+
Creates an xml element named C<$tag> containing escaped data (C<$text>).
27+
28+
=cut
29+
930
sub element {
10-
my ($tag,$text) = @_;
31+
my ($tag, $text) = @_;
1132
return '' if ! defined $text;
1233
return "<$tag>" . escape($text) . "</$tag>";
1334
}
1435

36+
=head2 elementNoEscape( $tag, $text )
37+
38+
Similar to C<element>, except that C<$text> is not escaped.
39+
40+
=cut
41+
1542
sub elementNoEscape {
16-
my ($tag,$text) = @_;
43+
my ($tag, $text) = @_;
1744
return '' if ! defined $text;
1845
return "<$tag>$text</$tag>";
1946
}
2047

48+
=head2 escape( $text )
49+
50+
Does minimal escaping on C<$text>.
51+
52+
=cut
53+
2154
sub escape {
2255
my $text = shift || '';
2356
$text =~ s/</&lt;/g;
@@ -26,6 +59,12 @@ sub escape {
2659
return $text;
2760
}
2861

62+
=head2 stylesheet( $uri )
63+
64+
A shortcut method to create an xml-stylesheet declaration.
65+
66+
=cut
67+
2968
sub stylesheet {
3069
my $uri = shift;
3170
return qq(<?xml-stylesheet type='text/xsl' href="$uri" ?>);

lib/SRU/Utils/XMLTest.pm

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ use base qw( Exporter );
77

88
our @EXPORT = qw( wellFormedXML );
99

10+
=head1 NAME
11+
12+
SRU::Utils::XMLTest - XML testing utility functions
13+
14+
=head1 SYNOPSIS
15+
16+
use SRU::Utils::XMLText;
17+
ok( wellFormedXML($xml), '$xml is well formed' );
18+
19+
=head1 DESCRIPTION
20+
21+
This is a set of utility functions for use with testing XML data.
22+
23+
=head1 METHODS
24+
25+
=head2 wellFormedXML( $xml )
26+
27+
Checks if C<$xml> is welformed.
28+
29+
=cut
30+
1031
sub wellFormedXML {
1132
my $xml_string = shift;
1233
eval {

t/pod_coverage.t

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
use Test::More;
2+
eval "use Test::Pod::Coverage 1.00";
3+
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
4+
all_pod_coverage_ok();

0 commit comments

Comments
 (0)