Skip to content

reneeb/Data-Validate-WithYAML-Plugin-Country

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Kwalitee status GitHub issues

NAME

Data::Validate::WithYAML::Plugin::Country - check whether a given value is a valid country code

VERSION

version 0.03

SYNOPSIS

Your test.pl:

use Data::Validate::WithYAML;

my $validator = Data::Validate::WithYAML->new( 'validate.yml' );
my %params    = (
    country => 'DE',
    # more user input
);
my %errors = $validator->validate( \%params );

Your validate.yml:

---
country:
  type: required
  plugin: Country
  format: alpha-2
  lang: en

Currently this module supports to formats: alpha-2 that are two-letter country codes like 'DE', 'FR', etc. and alpha-3 that is the three-letter code (e.g. DEU, FRA).

And it supports different languages so you use the country codes in your preferred language (see Locale::Country::Multilingual).

DESCRIPTION

Check if the given value is a valid country code.

METHODS

check

Development

The distribution is contained in a Git repository, so simply clone the repository

$ git clone git://github.com/reneeb/Data-Validate-WithYAML-Plugin-Country.git

and change into the newly-created directory.

$ cd Data-Validate-WithYAML-Plugin-Country

The project uses Dist::Zilla to build the distribution, hence this will need to be installed before continuing:

$ cpanm Dist::Zilla

To install the required prequisite packages, run the following set of commands:

$ dzil authordeps --missing | cpanm
$ dzil listdeps --author --missing | cpanm

The distribution can be tested like so:

$ dzil test

To run the full set of tests (including author and release-process tests), add the --author and --release options:

$ dzil test --author --release

AUTHOR

Renee Baecker reneeb@cpan.org

COPYRIGHT AND LICENSE

This software is Copyright (c) 2012 by Renee Baecker.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

About

Check if the given country code is valid.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages