W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2008

perl/modules/WebService/Validator/CSS/lib/WebService/Validator/CSS W3C.pm,1.11,1.12

From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 11 Feb 2008 04:56:13 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1JOQiD-0006fQ-5C@lionel-hutz.w3.org>

Update of /sources/public/perl/modules/WebService/Validator/CSS/lib/WebService/Validator/CSS
In directory hutz:/tmp/cvs-serv25519/lib/WebService/Validator/CSS

Modified Files:
	W3C.pm 
Log Message:
fixing warnings level param, update doc
per http://rt.cpan.org/Ticket/Display.html?id=33039



Index: W3C.pm
===================================================================
RCS file: /sources/public/perl/modules/WebService/Validator/CSS/lib/WebService/Validator/CSS/W3C.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- W3C.pm	11 Feb 2008 04:40:54 -0000	1.11
+++ W3C.pm	11 Feb 2008 04:56:11 -0000	1.12
@@ -20,7 +20,7 @@
                                    print screen tty tv presentation/;
 
 # warnings level currently supported by the W3C CSS Validator
-our $WARNINGS = map { $_ => 1 } qw/0 1 2 no/;
+our %WARNINGS = map { $_ => 1 } qw/0 1 2 no/;
 
 __PACKAGE__->mk_accessors    qw/user_agent validator_uri/;
 __PACKAGE__->mk_ro_accessors qw/response request_uri som success/;
@@ -127,15 +127,9 @@
     }
     
     if (defined $parm{warnings}) {
-        Carp::croak "warnings must be an integer 0 - 10\n"
-          unless $parm{warnings} =~ /^[0-9]|10$/;
-        
-        if ($parm{warnings} == 0) {
-            $uri->query_param(warning => "no");
-        }
-        else {
-            $uri->query_param(warning => $parm{warnings});
-        }
+        Carp::croak "warnings must be either \"no\" or an integer from 0 to 2\n"
+          unless $WARNINGS{$parm{warnings}};        
+        $uri->query_param(warning => $parm{warnings});
     }
     
     # request SOAP 1.2 output
@@ -296,10 +290,10 @@
 
 =item warnings => 2
 
-An integer C<0> - C<10> that determines how many warning messages you want to get
-back from the CSS Validator, C<0> means no warnings, C<10> would give most warnings,
-but is currently effectively the same as C<1>. The defaut is C<undef> in which case
-the CSS Validator determines a default value; this is expected to be as if C<2> had
+Either "no" or an integer C<0> - C<2> that determines how many warning messages you want to get
+back from the CSS Validator. "no" means no warning, C<0> means only the most serious warnings, 
+and C<2> will give all warnings, including low level ones. The defaut is C<undef> in which case
+the CSS Validator determines a default value; this is expected to be as if C<1> had
 been specified.
 
 =item language => "de"
Received on Monday, 11 February 2008 04:56:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:00 GMT