r1217 - in packages/liblocale-subcountry-perl/branches/upstream/current: . lib/Locale t
Gunnar Wolf
gwolf@costa.debian.org
Tue Jul 12 10:11:05 UTC 2005
Author: gwolf
Date: 2005-07-12 10:11:04 +0000 (Tue, 12 Jul 2005)
New Revision: 1217
Added:
packages/liblocale-subcountry-perl/branches/upstream/current/META.yml
packages/liblocale-subcountry-perl/branches/upstream/current/t/pod-coverage.t
packages/liblocale-subcountry-perl/branches/upstream/current/t/pod.t
Modified:
packages/liblocale-subcountry-perl/branches/upstream/current/Changes
packages/liblocale-subcountry-perl/branches/upstream/current/MANIFEST
packages/liblocale-subcountry-perl/branches/upstream/current/Makefile.PL
packages/liblocale-subcountry-perl/branches/upstream/current/README
packages/liblocale-subcountry-perl/branches/upstream/current/lib/Locale/SubCountry.pm
Log:
Load /tmp/tmp.GVxDfE/liblocale-subcountry-perl-1.36 into
packages/liblocale-subcountry-perl/branches/upstream/current.
Modified: packages/liblocale-subcountry-perl/branches/upstream/current/Changes
===================================================================
--- packages/liblocale-subcountry-perl/branches/upstream/current/Changes 2005-07-12 10:10:59 UTC (rev 1216)
+++ packages/liblocale-subcountry-perl/branches/upstream/current/Changes 2005-07-12 10:11:04 UTC (rev 1217)
@@ -1,36 +1,57 @@
-Revision history for Perl CPAN module Locale::SubCountry
-
-1.34 17 Apr 2004
- Fixed typo in XML data for American Samoa
-
- Added 'has_sub_countries' method to determine if a country has any sub countries
- (some such a Singapore do not). Updated synopsis to show it's use.
-
-1.33 13 Feb 2004
- Fixed pattern matching in data loader to allow for accented characters
-
-1.32 13 Feb 2004
- Added 'use locale' to main.t to stop 'make test' errors
-
-1.31 12 Feb 2004
- Moved XML data back into main module.
- Corrected documentation
-
-1.30 8 Feb 2004
-
- Completely updated data, many new countries and sub countries added
- Added countries without sub countries, such as Singapore
- Stored data in separate file in XML format
-
- Added method 'category' to return the type of subcountry such as state, city etc
- NOTE: this replaces the 'sub_country_type' method
-
- Added method 'regional_division' to return the regional_division of subcountry
- such as SCT (Scotland) for Edinburgh
-
+Revision history for Perl CPAN module Locale::SubCountry
+
+1.36 11 Jul 2005
+ Added regions for Andorra
+ Added regions for Grenada
+ Updated distribution to current CPAN requirements
+
+
+1.35 04 Jul 2005
+ Fixed problem with name space pollution for $VERSION variable
+
+ Added data for the following countries
+ Antigua and Barbuda
+ Andorra
+ Aruba
+ Bhutan
+ Nauru
+ Seychelles
+
+ For Cape Verde, changed Calheta de São Miguel to São Miguel
+ For Venezuela, changed Distrito Federal to Distrito Capital
+ Added districts for Honduras
+
+1.34 17 Apr 2004
+ Fixed typo in XML data for American Samoa
+
+ Added 'has_sub_countries' method to determine if a country has any sub countries
+ (some such a Singapore do not). Updated synopsis to show it's use.
+
+1.33 13 Feb 2004
+ Fixed pattern matching in data loader to allow for accented characters
+
+1.32 13 Feb 2004
+ Added 'use locale' to main.t to stop 'make test' errors
+
+1.31 12 Feb 2004
+ Moved XML data back into main module.
+ Corrected documentation
+
+1.30 8 Feb 2004
+
+ Completely updated data, many new countries and sub countries added
+ Added countries without sub countries, such as Singapore
+ Stored data in separate file in XML format
+
+ Added method 'category' to return the type of subcountry such as state, city etc
+ NOTE: this replaces the 'sub_country_type' method
+
+ Added method 'regional_division' to return the regional_division of subcountry
+ such as SCT (Scotland) for Edinburgh
+
1.23 16 Jul 2003
- Added data for Finland and Singapore, thanks to Chris McKay
+ Added data for Finland and Singapore, thanks to Chris McKay
1.22 18 Jan 2003
Removed use of $_ in initialization code, as suggested by Ilya Martynov
Modified: packages/liblocale-subcountry-perl/branches/upstream/current/MANIFEST
===================================================================
--- packages/liblocale-subcountry-perl/branches/upstream/current/MANIFEST 2005-07-12 10:10:59 UTC (rev 1216)
+++ packages/liblocale-subcountry-perl/branches/upstream/current/MANIFEST 2005-07-12 10:11:04 UTC (rev 1217)
@@ -1,6 +1,9 @@
MANIFEST
README
Makefile.PL
-SubCountry.pm
+lib/Locale/SubCountry.pm
Changes
-t/main.t
+t/main.t
+t/pod.t
+t/pod-coverage.t
+META.yml
Added: packages/liblocale-subcountry-perl/branches/upstream/current/META.yml
===================================================================
--- packages/liblocale-subcountry-perl/branches/upstream/current/META.yml 2005-07-12 10:10:59 UTC (rev 1216)
+++ packages/liblocale-subcountry-perl/branches/upstream/current/META.yml 2005-07-12 10:11:04 UTC (rev 1217)
@@ -0,0 +1,10 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
+name: Locale-SubCountry
+version: 1.36
+version_from: lib/Locale/SubCountry.pm
+installdirs: site
+requires:
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17
Modified: packages/liblocale-subcountry-perl/branches/upstream/current/Makefile.PL
===================================================================
--- packages/liblocale-subcountry-perl/branches/upstream/current/Makefile.PL 2005-07-12 10:10:59 UTC (rev 1216)
+++ packages/liblocale-subcountry-perl/branches/upstream/current/Makefile.PL 2005-07-12 10:11:04 UTC (rev 1217)
@@ -1,37 +1,12 @@
+use 5.008004;
use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-warn "\n"
- . "Locale::SubCountry will not be installed as it requires perl 5.005\n"
- . "or later and you only have $]\n"
- if $] < 5.005;
WriteMakefile
(
-
- 'VERSION_FROM' => 'SubCountry.pm',
- 'clean' =>
- {
- 'FILES' => 'blib/* Makefile MANIFEST Locale-SubCountry-*'
- },
- 'dist' =>
- {
- 'COMPRESS' => 'gzip',
- 'SUFFIX' => 'gz'
- },
- 'DISTNAME' => 'Locale-SubCountry',
-
- ( $] >= 5.005 ?
- (
- ABSTRACT => 'convert state, province, county ... names to/from ISO 3166-2 code',
- AUTHOR => 'Kim Ryan <kimryan at cpan org>',
- ) : ()
- ),
-
- 'NAME' => 'Locale::SubCountry',
- 'PM' =>
- {
- 'SubCountry.pm' => '$(INST_LIBDIR)/SubCountry.pm',
- },
+ 'NAME' => 'Locale::SubCountry',
+ 'VERSION_FROM' => 'lib/Locale/SubCountry.pm',
+ 'ABSTRACT' => 'convert state, province, county ... names to/from ISO 3166-2 code',
+ 'AUTHOR' => 'Kim Ryan <kimryan at cpan org>',
+ 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
);
Modified: packages/liblocale-subcountry-perl/branches/upstream/current/README
===================================================================
--- packages/liblocale-subcountry-perl/branches/upstream/current/README 2005-07-12 10:10:59 UTC (rev 1216)
+++ packages/liblocale-subcountry-perl/branches/upstream/current/README 2005-07-12 10:11:04 UTC (rev 1217)
@@ -4,53 +4,49 @@
SYNOPSIS
- my $UK = new Locale::SubCountry('GB');
- if ( $UK->has_sub_countries )
- {
- print($UK->full_name('DGY'),"\n"); # Dumfries and Galloway
- print($UK->regional_division('DGY'),"\n"); # SCT (Scotland)
- }
-
- my $australia = new Locale::SubCountry('AUSTRALIA');
- print($australia->country,"\n"); # AUSTRALIA
- print($australia->country_code,"\n"); # AU
-
- if ( $australia->has_sub_countries )
- {
- print($australia->code('New South Wales '),"\n"); # NSW
- print($australia->full_name('S.A.'),"\n"); # South Australia
- my $upper_case = 1;
- print($australia->full_name('Qld',$upper_case),"\n"); # QUEENSLAND
- print($australia->category('NSW'),"\n"); # state
- print($australia->FIPS10_4_code('ACT'),"\n"); # 01
- print($australia->ISO3166_2_code('02'),"\n"); # NSW
-
- my @aus_state_names = $australia->all_full_names;
- my @aus_code_names = $australia->all_codes;
- my %aus_states_keyed_by_code = $australia->code_full_name_hash;
- my %aus_states_keyed_by_name = $australia->full_name_code_hash;
-
- foreach my $code ( sort keys %aus_states_keyed_by_code )
- {
- printf("%-3s : %s\n",$code,$aus_states_keyed_by_code{$code});
- }
- }
-
- # Methods for country codes and names
-
- my $world = new Locale::SubCountry::World;
- my @all_countries = $world->all_full_names;
- my @all_country_codes = $world->all_codes;
-
- my %all_countries_keyed_by_name = $world->full_name_code_hash;
- my %all_country_keyed_by_code = $world->code_full_name_hash;
+ my $UK = new Locale::SubCountry('GB');
+ if ( $UK->has_sub_countries )
+ {
+ print($UK->full_name('DGY'),"\n"); # Dumfries and Galloway
+ print($UK->regional_division('DGY'),"\n"); # SCT (Scotland)
+ }
+ my $australia = new Locale::SubCountry('AUSTRALIA');
+ print($australia->country,"\n"); # AUSTRALIA
+ print($australia->country_code,"\n"); # AU
+ if ( $australia->has_sub_countries )
+ {
+ print($australia->code('New South Wales '),"\n"); # NSW
+ print($australia->full_name('S.A.'),"\n"); # South Australia
+ my $upper_case = 1;
+ print($australia->full_name('Qld',$upper_case),"\n"); # QUEENSLAND
+ print($australia->category('NSW'),"\n"); # state
+ print($australia->FIPS10_4_code('ACT'),"\n"); # 01
+ print($australia->ISO3166_2_code('02'),"\n"); # NSW
-REQUIRES
+ my @aus_state_names = $australia->all_full_names;
+ my @aus_code_names = $australia->all_codes;
+ my %aus_states_keyed_by_code = $australia->code_full_name_hash;
+ my %aus_states_keyed_by_name = $australia->full_name_code_hash;
-Perl 5.005 or above
+ foreach my $code ( sort keys %aus_states_keyed_by_code )
+ {
+ printf("%-3s : %s\n",$code,$aus_states_keyed_by_code{$code});
+ }
+ }
+
+ # Methods for country codes and names
+
+ my $world = new Locale::SubCountry::World;
+ my @all_countries = $world->all_full_names;
+ my @all_country_codes = $world->all_codes;
+ my %all_countries_keyed_by_name = $world->full_name_code_hash;
+ my %all_country_keyed_by_code = $world->code_full_name_hash;
+
+
+
HOW TO INSTALL
perl Makefile.PL
@@ -61,32 +57,24 @@
DESCRIPTION
-This module allows you to convert the full name for a countries administrative
-region to the code commonly used for postal addressing. The reverse lookup
-can also be done. Sub country codes are defined in "ISO 3166-2:1998,
-Codes for the representation of names of countries and their subdivisions".
-
-Sub countries are termed as states in the US and Australia, provinces
-in Canada and counties in the UK and Ireland.
-
-Names and ISO 3166-2 codes for all sub countries in a country can be
-returned as either a hash or an array.
-
-Names and ISO 3166-1 codes for all countries in the world can be
-returned as either a hash or an array.
-
-ISO 3166-2 codes can be converted to FIPS 10-4 codes. The reverse lookup can
-also be done.
+This module allows you to convert the full name for a countries administrative
+region to the code commonly used for postal addressing. The reverse lookup
+can also be done. Sub country codes are defined in "ISO 3166-2:1998,
+Codes for the representation of names of countries and their subdivisions".
-COPYRIGHT
+Sub countries are termed as states in the US and Australia, provinces
+in Canada and counties in the UK and Ireland.
+Names and ISO 3166-2 codes for all sub countries in a country can be
+returned as either a hash or an array.
-Copyright (c) 2004 Kim Ryan. All rights reserved.
-This program is free software; you can redistribute it
-and/or modify it under the terms of the Perl Artistic License
-(see http://www.perl.com/perl/misc/Artistic.html).
+Names and ISO 3166-1 codes for all countries in the world can be
+returned as either a hash or an array.
+ISO 3166-2 codes can be converted to FIPS 10-4 codes. The reverse lookup can
+also be done.
+
AUTHOR
Locale::SubCountry was written by Kim Ryan, kimryan at cpan dot org
@@ -101,12 +89,19 @@
Mark Summerfield and Guy Fraser provided the list of UK counties.
-TJ Mather suuplied the FIPS codes and many ammendments to the sub country data
+TJ Mather suuplied the FIPS codes and many amendments to the sub country data
+COPYRIGHT AND LICENCE
+Copyright (C) 2005 by Kim Ryan. All rights reserved.
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.8.4 or,
+at your option, any later version of Perl 5 you may have available.
+
+
Modified: packages/liblocale-subcountry-perl/branches/upstream/current/lib/Locale/SubCountry.pm
===================================================================
--- packages/liblocale-subcountry-perl/branches/upstream/current/lib/Locale/SubCountry.pm 2005-07-12 10:10:59 UTC (rev 1216)
+++ packages/liblocale-subcountry-perl/branches/upstream/current/lib/Locale/SubCountry.pm 2005-07-12 10:11:04 UTC (rev 1217)
@@ -7,8 +7,8 @@
my $UK = new Locale::SubCountry('GB');
if ( $UK->has_sub_countries )
{
- print($UK->full_name('DGY'),"\n"); # Dumfries and Galloway
- print($UK->regional_division('DGY'),"\n"); # SCT (Scotland)
+ print($UK->full_name('DGY'),"\n"); # Dumfries and Allow
+ print($UK->regional_division('DGY'),"\n"); # CT (Scotland)
}
my $australia = new Locale::SubCountry('AUSTRALIA');
@@ -46,11 +46,6 @@
my %all_country_keyed_by_code = $world->code_full_name_hash;
-=head1 REQUIRES
-
-Perl 5.005 or above
-
-
=head1 DESCRIPTION
This module allows you to convert the full name for a countries administrative
@@ -172,14 +167,19 @@
province,state and district. The category is returned as a capitalised string,
or "unknown" if no match is found.
-=head2 regionional_division
+=head2 regional_division
-Given a sub country object, the C<region> method takes the ISO 3166-2 code of
-a sub country and returns the sub country's regionional_division. This is,
-an alphanumeric code. The regionional_division is returned as a capitalised string,
-or "unknown" if no match is found.
+Given a sub country object, the C<regional_division> method takes the
+ISO 3166-2 code of a sub country and returns the sub country's
+regionional_division. This is, an alphanumeric code. The regional_division
+is returned as a capitalised string, or "unknown" if no match is found.
+=head2 has_sub_countries
+Given a sub country object, the C<has_sub_countries> method returns 1 if the
+current country has sub countries, or 0 if it does not. Some small countires
+such as Singapore do not have sub countries.
+
=head2 FIPS10_4_code
Given a sub country object, the C<FIPS_10_4_code> method takes the ISO 3166-2 code
@@ -196,27 +196,23 @@
=head2 full_name_code_hash (for subcountry objects)
Given a sub country object, returns a hash of all full name/code pairs,
-keyed by sub country name. If the country has no sub countries, such as Singapore,
-returns undef.
+keyed by sub country name. If the country has no sub countries, returns undef.
=head2 code_full_name_hash (for subcountry objects)
Given a sub country object, returns a hash of all code/full name pairs,
-keyed by sub country code. If the country has no sub countries, such as Singapore,
-returns undef.
+keyed by sub country code. If the country has no sub countries, returns undef.
=head2 all_full_names (for subcountry objects)
Given a sub country object, returns an array of all sub country full names,
-sorted alphabetically. If the country has no sub countries, such as Singapore,
-returns undef.
+sorted alphabetically. If the country has no sub countries, returns undef.
=head2 all_codes (for subcountry objects)
Given a sub country object, returns an array of all sub country ISO 3166-2 codes,
-sorted alphabetically. If the country has no sub countries, such as Singapore,
-returns undef.
+sorted alphabetically. If the country has no sub countries, returns undef.
@@ -233,12 +229,11 @@
1995 April Specifications for COUNTRIES, DEPENDENCIES, AREAS OF SPECIAL SOVEREIGNTY,
AND THEIR PRINCIPAL ADMINISTRATIVE DIVISIONS
-<http://www.statoids.com/statoids.html>
+L<http://www.statoids.com/statoids.html>
- Locale::Country
- Lingua::EN::AddressParse
- Geo::IP
+L<Locale::Country>,L<Lingua::EN::AddressParse>,
+L<Geo::StreetAddress::US>L<Geo::PostalAddress>L<Geo::IP>
=head1 LIMITATIONS
@@ -278,14 +273,6 @@
None known
-=head1 COPYRIGHT
-
-
-Copyright (c) 2004 Kim Ryan. All rights reserved.
-This program is free software; you can redistribute it
-and/or modify it under the terms of the Perl Artistic License
-
-
=head1 AUTHOR
Locale::SubCountry was written by Kim Ryan <kimryan at cpan dot org>.
@@ -303,6 +290,15 @@
TJ Mather supplied the FIPS codes and many ammendments to the sub country data
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (c) 2005 Kim Ryan. All rights reserved.
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.8.4 or,
+at your option, any later version of Perl 5 you may have available.
+
+
=cut
#-------------------------------------------------------------------------------
@@ -311,8 +307,6 @@
use locale;
use Exporter;
-use vars qw ($VERSION);
-$VERSION = '1.34';
#-------------------------------------------------------------------------------
@@ -372,10 +366,13 @@
#-------------------------------------------------------------------------------
package Locale::SubCountry;
+
+our $VERSION = '1.36';
+
#-------------------------------------------------------------------------------
# Initialization code must be run first to create global data structure.
-# Read in the list of abbreivations and full names defined in the __DATA__
+# Read in the list of abbreviations and full names defined in the __DATA__
# block at the bottom of this file.
{
@@ -431,7 +428,7 @@
$sub_country_finished = 1;
# Insert into doubly indexed hash, grouped by country for ISO 3166-2
- # codes. One hash is keyed by abbreviaton and one by full name. Although
+ # codes. One hash is keyed by abbreviation and one by full name. Although
# data is duplicated, this provides the fastest lookup and simplest code.
$::subcountry_lookup{$country_name}{_code_keyed}{$sub_country_code} = $sub_country_name;
@@ -711,7 +708,7 @@
}
}
#-------------------------------------------------------------------------------
-# Returns 1 if the current country has sub countires. otherwise 0.
+# Returns 1 if the current country has sub countries. otherwise 0.
sub has_sub_countries
{
@@ -817,7 +814,7 @@
#-------------------------------------------------------------------------------
-# Code/Sub country data in XML format. Read in at start up by first un-named block.
+# Code/Sub country data in XML format. Read in at start up by first unnamed block.
__DATA__
@@ -1005,6 +1002,7 @@
</subcountry>
</country>
+
<country>
<name>HONDURAS</name>
<code>HN</code>
@@ -8060,6 +8058,7 @@
</subcountry>
</country>
+
<country>
<name>BHUTAN</name>
<code>BT</code>
@@ -22652,6 +22651,11 @@
</country>
<country>
+ <name>ANTIGUA AND BARBUDA</name>
+ <code>AG</code>
+</country>
+
+<country>
<name>BERMUDA</name>
<code>BM</code>
</country>
@@ -22664,8 +22668,44 @@
<country>
<name>ANDORRA</name>
<code>AD</code>
+ <subcountry>
+ <name>Andorra la Vella</name>
+ <code>AN</code>
+ <FIPS>07</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Canillo</name>
+ <code>CA</code>
+ <FIPS>02</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Encamp</name>
+ <code>EN</code>
+ <FIPS>03</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Escaldes-Engordany</name>
+ <code>EE</code>
+ <FIPS>08</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>La Massana</name>
+ <code>MA</code>
+ <FIPS>04</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Ordino</name>
+ <code>OR</code>
+ <FIPS>05</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Sant Julià de Lòria</name>
+ <code>JL</code>
+ <FIPS>06</FIPS>
+ </subcountry>
</country>
+
<country>
<name>MONTSERRAT</name>
<code>MS</code>
@@ -22724,6 +22764,41 @@
<country>
<name>GRENADA</name>
<code>GD</code>
+ <subcountry>
+ <name>Carriacou</name>
+ <code>CA</code>
+ <FIPS></FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Saint Andrew</name>
+ <code>AN</code>
+ <FIPS>1</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Saint David</name>
+ <code>DA</code>
+ <FIPS>2</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Saint George</name>
+ <code>GE</code>
+ <FIPS>3</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Saint John</name>
+ <code>JO</code>
+ <FIPS>4</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Saint Mark</name>
+ <code>MA</code>
+ <FIPS>5</FIPS>
+ </subcountry>
+ <subcountry>
+ <name>Saint Patrick</name>
+ <code>PA</code>
+ <FIPS>6</FIPS>
+ </subcountry>
</country>
<country>
@@ -22736,5 +22811,18 @@
<code>TV</code>
</country>
+<country>
+ <name>NAURU</name>
+ <code>NR</code>
+</country>
+<country>
+ <name>SEYCHELLES</name>
+ <code>SC</code>
+</country>
+
+
+
+
+
</ISO_3166_2>
Added: packages/liblocale-subcountry-perl/branches/upstream/current/t/pod-coverage.t
===================================================================
--- packages/liblocale-subcountry-perl/branches/upstream/current/t/pod-coverage.t 2005-07-12 10:10:59 UTC (rev 1216)
+++ packages/liblocale-subcountry-perl/branches/upstream/current/t/pod-coverage.t 2005-07-12 10:11:04 UTC (rev 1217)
@@ -0,0 +1,6 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
+all_pod_coverage_ok();
Property changes on: packages/liblocale-subcountry-perl/branches/upstream/current/t/pod-coverage.t
___________________________________________________________________
Name: svn:executable
+ *
Added: packages/liblocale-subcountry-perl/branches/upstream/current/t/pod.t
===================================================================
--- packages/liblocale-subcountry-perl/branches/upstream/current/t/pod.t 2005-07-12 10:10:59 UTC (rev 1216)
+++ packages/liblocale-subcountry-perl/branches/upstream/current/t/pod.t 2005-07-12 10:11:04 UTC (rev 1217)
@@ -0,0 +1,6 @@
+#!perl -T
+
+use Test::More;
+eval "use Test::Pod 1.14";
+plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+all_pod_files_ok();
Property changes on: packages/liblocale-subcountry-perl/branches/upstream/current/t/pod.t
___________________________________________________________________
Name: svn:executable
+ *
More information about the Pkg-perl-cvs-commits
mailing list