From 7b92bfb9561692855fa32953458436beb4b78b8b Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Thu, 16 May 2019 09:41:24 -0400 Subject: [PATCH] Added "Vale of Glamorgan" --- .appveyor.yml | 37 +++++++++-- .travis.yml | 6 +- MANIFEST | 1 + README | 4 +- README.md | 80 ++++++++++++++++++++++- lib/CGI/Untaint/CountyStateProvince/GB.pm | 11 +--- t/no404s.t | 16 +++++ 7 files changed, 135 insertions(+), 20 deletions(-) create mode 100644 t/no404s.t diff --git a/.appveyor.yml b/.appveyor.yml index 2cda919..b97a901 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,17 +1,40 @@ version: 1.0.{build} +image: + - Visual Studio 2015 + - Ubuntu + - ubuntu1804 + +environment: + PERL5LIB: /home/appveyor/perl5/lib/perl5 + AUTOMATED_TESTING: 1 + +platform: x64 + +branches: + only: + - master + +skip_tags: true + install: - - cinst StrawberryPerl - - path C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH% - - mkdir %APPVEYOR_BUILD_FOLDER%\tmp - - set TMPDIR=%APPVEYOR_BUILD_FOLDER%\tmp + - cmd: if not exist "C:\strawberry" cinst StrawberryPerl --allow-empty-checksums + - cmd: path C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH% + # - cmd: cd C:\projects\%APPVEYOR_PROJECT_NAME% + - sh: sudo apt-get update -q + - sh: sudo apt-get install -y build-essential libssl-dev perl + - sh: export PATH=/home/appveyor/perl5/bin:$PATH - perl -V + - cmd: mkdir %APPVEYOR_BUILD_FOLDER%\tmp + - cmd: set TMPDIR=%APPVEYOR_BUILD_FOLDER%\tmp - cpan App::cpanminus - - cpanm -q --showdeps --with-develop --with-suggests . | findstr /v "^perl\>" | cpanm -n - - 'echo End install at: & time /t' + - cmd: cpanm -q --showdeps --with-develop --with-suggests . | findstr /v "^perl\>" | cpanm -n + - cpanm -v --installdeps . + - cmd: 'echo End install at: & time /t' build_script: - perl Makefile.PL test_script: - - gmake test + - cmd: gmake test + - sh: make test diff --git a/.travis.yml b/.travis.yml index 14b6a40..cf87869 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ os: # - osx perl: + - "5.28" + - "5.26" - "5.24" - "5.22" - "5.20" @@ -12,8 +14,10 @@ perl: - "5.14" - "5.12" +sudo: false + before_install: - cpanm -n Devel::Cover::Report::Coveralls Test::Script Test::Pod::Spelling::CommonMistakes Test::Portability::Files Test::Taint JSON::XS + cpanm -n Devel::Cover::Report::Coveralls Test::Script Test::Pod::Spelling::CommonMistakes Test::Portability::Files install: - cpanm -v --installdeps --notest . diff --git a/MANIFEST b/MANIFEST index d374911..96894b5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -17,6 +17,7 @@ t/gv.t t/kwalitee.t t/manifest.t t/metrics.t +t/no404s.t t/noplan.t t/pod-cm.t t/pod.t diff --git a/README b/README index 78f0fc2..cd565a5 100644 --- a/README +++ b/README @@ -33,6 +33,6 @@ You can also look for information at: LICENSE AND COPYRIGHT -Copyright (C) 2012-16 Nigel Horne +Copyright (C) 2012-19 Nigel Horne -This program is released under the following licence: GPL +This program is released under the following licence: GPL2 diff --git a/README.md b/README.md index a19edea..12a7fca 100644 --- a/README.md +++ b/README.md @@ -5,5 +5,81 @@ CGI-Untaint-CountyStateProvince-GB [![Windows Build status](https://ci.appveyor.com/api/projects/status/xbcdo4fx8onmoohf/branch/master?svg=true)](https://ci.appveyor.com/project/nigelhorne/cgi-untaint-countystateprovince-gb/branch/master) [![Dependency Status](https://dependencyci.com/github/nigelhorne/CGI-Untaint-CountyStateProvince-GB/badge)](https://dependencyci.com/github/nigelhorne/CGI-Untaint-CountyStateProvince-GB) -Information about the CGI environment -Add British counties to CGI::Untaint::CountyStateProvince tables +# NAME + +CGI::Untaint::CountyStateProvince::GB - Add British counties to CGI::Untaint::CountyStateProvince tables + +# VERSION + +Version 0.11 + +# SYNOPSIS + +Adds a list of British counties to the list of counties/state/provinces +which are known by the CGI::Untaint::CountyStateProvince validator so that +an HTML form sent by CGI contains a valid county. + +You must include CGI::Untaint::CountyStateProvince::GB after including +CGI::Untaint, otherwise it won't work. + + use CGI::Info; + use CGI::Untaint; + use CGI::Untaint::CountyStateProvince::GB; + my $info = CGI::Info->new(); + my $u = CGI::Untaint->new($info->params()); + # Succeeds if state = 'Kent', fails if state = 'Queensland'; + $u->extract(-as_CountyStateProvince => 'state'); + # ... + +# SUBSOUTINES/METHODS + +## is\_valid + +Validates the data. See CGI::Untaint::is\_valid. + +## value + +Sets the raw data which is to be validated. Called by the superclass, you +are unlikely to want to call it. + +# AUTHOR + +Nigel Horne, `` + +# BUGS + +Please report any bugs or feature requests to `bug-cgi-untaint-csp-gb at rt.cpan.org`, or through +the web interface at [http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Untaint-CountyStateProvince](http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Untaint-CountyStateProvince). I will be notified, and then you'll +automatically be notified of progress on your bug as I make changes. + +# SEE ALSO + +CGI::Untaint::CountyStateProvince, CGI::Untaint + +# SUPPORT + +You can find documentation for this module with the perldoc command. + + perldoc CGI::Untaint::CountyStateProvince::GB + +You can also look for information at: + +- RT: CPAN's request tracker + + [http://rt.cpan.org/NoAuth/Bugs.html?Dist=CGI-Untaint-CountyStateProvince-GB](http://rt.cpan.org/NoAuth/Bugs.html?Dist=CGI-Untaint-CountyStateProvince-GB) + +- CPAN Ratings + + [http://cpanratings.perl.org/d/CGI-Untaint-CountyStateProvince-GB](http://cpanratings.perl.org/d/CGI-Untaint-CountyStateProvince-GB) + +- Search CPAN + + [http://search.cpan.org/dist/CGI-Untaint-CountyStateProvince-GB](http://search.cpan.org/dist/CGI-Untaint-CountyStateProvince-GB) + +# ACKNOWLEDGEMENTS + +# LICENSE AND COPYRIGHT + +Copyright 2012-19 Nigel Horne. + +This program is released under the following licence: GPL2 diff --git a/lib/CGI/Untaint/CountyStateProvince/GB.pm b/lib/CGI/Untaint/CountyStateProvince/GB.pm index cabf355..76fd6a7 100644 --- a/lib/CGI/Untaint/CountyStateProvince/GB.pm +++ b/lib/CGI/Untaint/CountyStateProvince/GB.pm @@ -139,6 +139,7 @@ our %abbreviations = ( 's yorkshire' => 'south yorkshire', 's glos' => 'gloucestershire', 'south gloster' => 'gloucestershire', + 'vale of glamorgan' => 'glamorgan', 'westmidlands' => 'west midlands', 'west mids' => 'west midlands', 'west yorks' => 'west yorkshire', @@ -248,7 +249,6 @@ You can find documentation for this module with the perldoc command. perldoc CGI::Untaint::CountyStateProvince::GB - You can also look for information at: =over 4 @@ -257,10 +257,6 @@ You can also look for information at: L -=item * AnnoCPAN: Annotated CPAN documentation - -L - =item * CPAN Ratings L @@ -277,10 +273,9 @@ L =head1 LICENSE AND COPYRIGHT -Copyright 2012-16 Nigel Horne. - -This program is released under the following licence: GPL +Copyright 2012-19 Nigel Horne. +This program is released under the following licence: GPL2 =cut diff --git a/t/no404s.t b/t/no404s.t new file mode 100644 index 0000000..d4e393f --- /dev/null +++ b/t/no404s.t @@ -0,0 +1,16 @@ +#!perl -wT + +use strict; +use warnings; +use Test::Most; + +if(not $ENV{AUTHOR_TESTING}) { + plan(skip_all => 'Author tests not required for installation'); +} + +eval "use Test::Pod::No404s"; +if($@) { + plan(skip_all => 'Test::Pod::No404s required for testing POD'); +} else { + all_pod_files_ok(); +}