r9588 - in /branches/upstream/liblocale-us-perl: ./ current/ current/Changes current/MANIFEST current/META.yml current/Makefile.PL current/README current/US.pm current/codes.dat current/kruft.txt current/kruft2codes.pl current/t/ current/t/1.t

emhn-guest at users.alioth.debian.org emhn-guest at users.alioth.debian.org
Mon Nov 19 11:38:22 UTC 2007


Author: emhn-guest
Date: Mon Nov 19 11:38:21 2007
New Revision: 9588

URL: http://svn.debian.org/wsvn/?sc=1&rev=9588
Log:
[svn-inject] Installing original source of liblocale-us-perl

Added:
    branches/upstream/liblocale-us-perl/
    branches/upstream/liblocale-us-perl/current/
    branches/upstream/liblocale-us-perl/current/Changes
    branches/upstream/liblocale-us-perl/current/MANIFEST
    branches/upstream/liblocale-us-perl/current/META.yml
    branches/upstream/liblocale-us-perl/current/Makefile.PL
    branches/upstream/liblocale-us-perl/current/README
    branches/upstream/liblocale-us-perl/current/US.pm
    branches/upstream/liblocale-us-perl/current/codes.dat
    branches/upstream/liblocale-us-perl/current/kruft.txt
    branches/upstream/liblocale-us-perl/current/kruft2codes.pl   (with props)
    branches/upstream/liblocale-us-perl/current/t/
    branches/upstream/liblocale-us-perl/current/t/1.t

Added: branches/upstream/liblocale-us-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/Changes?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/Changes (added)
+++ branches/upstream/liblocale-us-perl/current/Changes Mon Nov 19 11:38:21 2007
@@ -1,0 +1,6 @@
+Revision history for Perl extension Locale::US.
+
+0.01  Mon Sep 15 12:44:19 2003
+	- original version; created by h2xs 1.22 with options
+		-b 5.6.1 -A -X -n Locale::US
+

Added: branches/upstream/liblocale-us-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/MANIFEST?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/MANIFEST (added)
+++ branches/upstream/liblocale-us-perl/current/MANIFEST Mon Nov 19 11:38:21 2007
@@ -1,0 +1,10 @@
+kruft.txt
+kruft2codes.pl
+codes.dat
+Changes
+Makefile.PL
+MANIFEST
+README
+US.pm
+t/1.t
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/liblocale-us-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/META.yml?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/META.yml (added)
+++ branches/upstream/liblocale-us-perl/current/META.yml Mon Nov 19 11:38:21 2007
@@ -1,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-US
+version:      1.2
+version_from: US.pm
+installdirs:  site
+requires:
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17

Added: branches/upstream/liblocale-us-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/Makefile.PL?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/Makefile.PL (added)
+++ branches/upstream/liblocale-us-perl/current/Makefile.PL Mon Nov 19 11:38:21 2007
@@ -1,0 +1,12 @@
+use 5.006001;
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    'NAME'		=> 'Locale::US',
+    'VERSION_FROM'	=> 'US.pm', # finds $VERSION
+    'PREREQ_PM'		=> {}, # e.g., Module::Name => 1.1
+    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
+      (ABSTRACT_FROM => 'US.pm', # retrieve abstract from module
+       AUTHOR     => 'A. U. Thor <tbone at dev.directsynergy.com>') : ()),
+);

Added: branches/upstream/liblocale-us-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/README?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/README (added)
+++ branches/upstream/liblocale-us-perl/current/README Mon Nov 19 11:38:21 2007
@@ -1,0 +1,21 @@
+               Locale-US Distribution
+                       v1.1
+
+This distribution contains a module which can be used to process
+USPS two letter codes for states in the United States and 
+surrounding territories.
+
+    Locale::US
+        Two letter codes for state identification.
+        For example, 'AL' is the code for 'Alabama'.
+
+To install this module, copy to US.pm somewhere on your PERL5LIB path or 
+use 'use lib'  
+
+The module is documented using pod. 
+
+Please let me know if you experience any problems with these modules,
+or have any ideas for additions.
+
+
+Terrence Brannon <tbone at cpan.org>

Added: branches/upstream/liblocale-us-perl/current/US.pm
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/US.pm?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/US.pm (added)
+++ branches/upstream/liblocale-us-perl/current/US.pm Mon Nov 19 11:38:21 2007
@@ -1,0 +1,212 @@
+package Locale::US;
+
+use 5.006001;
+use strict;
+use warnings;
+
+use Data::Dumper;
+
+require Exporter;
+
+our @ISA = qw(Exporter);
+
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+
+# This allows declaration	use Locale::US ':all';
+# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
+# will save memory.
+our %EXPORT_TAGS = ( 'all' => [ qw(
+	
+) ] );
+
+our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
+
+our @EXPORT = qw(
+	
+);
+
+our $VERSION = '1.2';
+
+
+# Preloaded methods go here.
+
+sub new {
+    
+    my $class = shift;
+    my $self = {} ;
+
+    while ( <DATA>) {
+	chomp;
+#	warn $_;
+	last if /__END__/;
+	my ($code, $state) = split ':';
+	$self->{code2state}{$code}  = $state;
+	$self->{state2code}{$state} = $code;
+    }
+
+#    warn Dumper $self;
+    bless $self, $class;
+}
+
+sub all_state_codes {
+
+    my $self = shift;
+
+    keys % { $self->{code2state} } ;
+
+}
+
+sub all_state_names {
+
+    my $self = shift;
+
+    keys % { $self->{state2code} } ;
+
+}
+
+1;
+
+__DATA__
+AL:ALABAMA
+AK:ALASKA
+AS:AMERICAN SAMOA
+AZ:ARIZONA
+AR:ARKANSAS
+CA:CALIFORNIA
+CO:COLORADO
+CT:CONNECTICUT
+DE:DELAWARE
+DC:DISTRICT OF COLUMBIA
+FM:FEDERATED STATES OF MICRONESIA
+FL:FLORIDA
+GA:GEORGIA
+GU:GUAM
+HI:HAWAII
+ID:IDAHO
+IL:ILLINOIS
+IN:INDIANA
+IA:IOWA
+KS:KANSAS
+KY:KENTUCKY
+LA:LOUISIANA
+ME:MAINE
+MH:MARSHALL ISLANDS
+MD:MARYLAND
+MA:MASSACHUSETTS
+MI:MICHIGAN
+MN:MINNESOTA
+MS:MISSISSIPPI
+MO:MISSOURI
+MT:MONTANA
+NE:NEBRASKA
+NV:NEVADA
+NH:NEW HAMPSHIRE
+NJ:NEW JERSEY
+NM:NEW MEXICO
+NY:NEW YORK
+NC:NORTH CAROLINA
+ND:NORTH DAKOTA
+MP:NORTHERN MARIANA ISLANDS
+OH:OHIO
+OK:OKLAHOMA
+OR:OREGON
+PW:PALAU
+PA:PENNSYLVANIA
+PR:PUERTO RICO
+RI:RHODE ISLAND
+SC:SOUTH CAROLINA
+SD:SOUTH DAKOTA
+TN:TENNESSEE
+TX:TEXAS
+UT:UTAH
+VT:VERMONT
+VI:VIRGIN ISLANDS
+VA:VIRGINIA
+WA:WASHINGTON
+WV:WEST VIRGINIA
+WI:WISCONSIN
+WY:WYOMING
+__END__
+# Below is stub documentation for your module. You'd better edit it!
+
+=head1 NAME
+
+Locale::US - two letter codes for state identification in the United States and vice versa.
+
+=head1 SYNOPSIS
+
+  use Locale::US;
+ 
+  my $u = new Locale::US;
+
+  my $state = $u->{code2state}{$code};
+  my $code  = $u->{state2code}{$state};
+
+  my @state = $u->all_state_names;
+  my @code  = $u->all_state_codes;
+
+
+=head1 ABSTRACT
+
+Map from US two-letter codes to statees and vice versa.
+
+=head1 DESCRIPTION
+
+=head2 MAPPING
+
+=head3 $self->{code2state}
+
+=head3 $self->{state2code}
+
+=head2 DUMPING
+
+=head3 $self->all_state_names
+
+=head3 $self->all_state_codes
+
+
+=head1 KNOWN BUGS AND LIMITATIONS
+
+=over 4
+
+=item * The state name is returned in C<uc()> format.
+
+=item * neither hash is strict, though they should be.
+
+=back
+
+=head1 SEE ALSO
+
+
+L<Locale::Country>
+
+http://www.usps.gov/ncsc/lookups/usps_abbreviations.htm
+
+    Online file with the USPS two-letter codes for the United States and its possessions.
+
+=head1 AUXILLIARY CODE:
+
+lynx -dump http://www.usps.gov/ncsc/lookups/usps_abbreviations.htm > kruft.txt
+kruft2codes.pl
+
+=head1 COPYRIGHT INFO
+
+Copyright: Copyright (c) 2002-2007 Terrence Brannon.  
+All rights reserved.  This program is free software; you can redistribute it and/or modify it 
+under the same terms as Perl itself.
+
+License: GPL, Artistic, available in the Debian Linux Distribution at
+/usr/share/common-licenses/{GPL,Artistic}
+
+
+=head1 AUTHOR
+
+T. M. Brannon, <tbone at cpan.org>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2003 by T. M. Brannon
+
+=cut

Added: branches/upstream/liblocale-us-perl/current/codes.dat
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/codes.dat?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/codes.dat (added)
+++ branches/upstream/liblocale-us-perl/current/codes.dat Mon Nov 19 11:38:21 2007
@@ -1,0 +1,59 @@
+AL:ALABAMA
+AK:ALASKA
+AS:AMERICAN SAMOA
+AZ:ARIZONA
+AR:ARKANSAS
+CA:CALIFORNIA
+CO:COLORADO
+CT:CONNECTICUT
+DE:DELAWARE
+DC:DISTRICT OF COLUMBIA
+FM:FEDERATED STATES OF MICRONESIA
+FL:FLORIDA
+GA:GEORGIA
+GU:GUAM
+HI:HAWAII
+ID:IDAHO
+IL:ILLINOIS
+IN:INDIANA
+IA:IOWA
+KS:KANSAS
+KY:KENTUCKY
+LA:LOUISIANA
+ME:MAINE
+MH:MARSHALL ISLANDS
+MD:MARYLAND
+MA:MASSACHUSETTS
+MI:MICHIGAN
+MN:MINNESOTA
+MS:MISSISSIPPI
+MO:MISSOURI
+MT:MONTANA
+NE:NEBRASKA
+NV:NEVADA
+NH:NEW HAMPSHIRE
+NJ:NEW JERSEY
+NM:NEW MEXICO
+NY:NEW YORK
+NC:NORTH CAROLINA
+ND:NORTH DAKOTA
+MP:NORTHERN MARIANA ISLANDS
+OH:OHIO
+OK:OKLAHOMA
+OR:OREGON
+PW:PALAU
+PA:PENNSYLVANIA
+PR:PUERTO RICO
+RI:RHODE ISLAND
+SC:SOUTH CAROLINA
+SD:SOUTH DAKOTA
+TN:TENNESSEE
+TX:TEXAS
+UT:UTAH
+VT:VERMONT
+VI:VIRGIN ISLANDS
+VA:VIRGINIA
+WA:WASHINGTON
+WV:WEST VIRGINIA
+WI:WISCONSIN
+WY:WYOMING

Added: branches/upstream/liblocale-us-perl/current/kruft.txt
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/kruft.txt?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/kruft.txt (added)
+++ branches/upstream/liblocale-us-perl/current/kruft.txt Mon Nov 19 11:38:21 2007
@@ -1,0 +1,236 @@
+   ALABAMA
+   
+                                     AL
+   
+   ALASKA
+   
+                                     AK
+   
+   AMERICAN SAMOA
+   
+                                     AS
+   
+   ARIZONA
+   
+                                     AZ
+   
+   ARKANSAS
+   
+                                     AR
+   
+   CALIFORNIA
+   
+                                     CA
+   
+   COLORADO
+   
+                                     CO
+   
+   CONNECTICUT
+   
+                                     CT
+   
+   DELAWARE
+   
+                                     DE
+   
+   DISTRICT OF COLUMBIA
+   
+                                     DC
+   
+   FEDERATED STATES OF MICRONESIA
+   
+                                     FM
+   
+   FLORIDA
+   
+                                     FL
+   
+   GEORGIA
+   
+                                     GA
+   
+   GUAM
+   
+                                     GU
+   
+   HAWAII
+   
+                                     HI
+   
+   IDAHO
+   
+                                     ID
+   
+   ILLINOIS
+   
+                                     IL
+   
+   INDIANA
+   
+                                     IN
+   
+   IOWA
+   
+                                     IA
+   
+   KANSAS
+   
+                                     KS
+   
+   KENTUCKY
+   
+                                     KY
+   
+   LOUISIANA
+   
+                                     LA
+   
+   MAINE
+   
+                                     ME
+   
+   MARSHALL ISLANDS
+   
+                                     MH
+   
+   MARYLAND
+   
+                                     MD
+   
+   MASSACHUSETTS
+   
+                                     MA
+   
+   MICHIGAN
+   
+                                     MI
+   
+   MINNESOTA
+   
+                                     MN
+   
+   MISSISSIPPI
+   
+                                     MS
+   
+   MISSOURI
+   
+                                     MO
+   
+   MONTANA
+   
+                                     MT
+   
+   NEBRASKA
+   
+                                     NE
+   
+   NEVADA
+   
+                                     NV
+   
+   NEW HAMPSHIRE
+   
+                                     NH
+   
+   NEW JERSEY
+   
+                                     NJ
+   
+   NEW MEXICO
+   
+                                     NM
+   
+   NEW YORK
+   
+                                     NY
+   
+   NORTH CAROLINA
+   
+                                     NC
+   
+   NORTH DAKOTA
+   
+                                     ND
+   
+   NORTHERN MARIANA ISLANDS
+   
+                                     MP
+   
+   OHIO
+   
+                                     OH
+   
+   OKLAHOMA
+   
+                                     OK
+   
+   OREGON
+   
+                                     OR
+   
+   PALAU
+   
+                                     PW
+   
+   PENNSYLVANIA
+   
+                                     PA
+   
+   PUERTO RICO
+   
+                                     PR
+   
+   RHODE ISLAND
+   
+                                     RI
+   
+   SOUTH CAROLINA
+   
+                                     SC
+   
+   SOUTH DAKOTA
+   
+                                     SD
+   
+   TENNESSEE
+   
+                                     TN
+   
+   TEXAS
+   
+                                     TX
+   
+   UTAH
+   
+                                     UT
+   
+   VERMONT
+   
+                                     VT
+   
+   VIRGIN ISLANDS
+   
+                                     VI
+   
+   VIRGINIA
+   
+                                     VA
+   
+   WASHINGTON
+   
+                                     WA
+   
+   WEST VIRGINIA
+   
+                                     WV
+   
+   WISCONSIN
+   
+                                     WI
+   
+   WYOMING
+   
+                                     WY
+   

Added: branches/upstream/liblocale-us-perl/current/kruft2codes.pl
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/kruft2codes.pl?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/kruft2codes.pl (added)
+++ branches/upstream/liblocale-us-perl/current/kruft2codes.pl Mon Nov 19 11:38:21 2007
@@ -1,0 +1,28 @@
+#!/usr/bin/perl
+
+#system 'lynx -dump http://www.usps.gov/ncsc/lookups/usps_abbreviations.htm > kruft.txt';
+open P, 'kruft.txt';
+
+while (<P>) {
+    if (/\w/) 
+    {
+
+	$_ =~ s/^\s+//;
+	$_ =~ s/\s+$//;
+
+	if (++$line_count % 2) 
+	{
+	    $current_state=$_;
+	} 
+	else 
+	{
+	    $code{$current_state}=$_;
+	}
+    }    
+}
+
+open C, '>codes.dat';
+foreach (sort keys %code) {
+    print C "$code{$_}:$_\n";
+}
+

Propchange: branches/upstream/liblocale-us-perl/current/kruft2codes.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/liblocale-us-perl/current/t/1.t
URL: http://svn.debian.org/wsvn/branches/upstream/liblocale-us-perl/current/t/1.t?rev=9588&op=file
==============================================================================
--- branches/upstream/liblocale-us-perl/current/t/1.t (added)
+++ branches/upstream/liblocale-us-perl/current/t/1.t Mon Nov 19 11:38:21 2007
@@ -1,0 +1,35 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl 1.t'
+
+#########################
+
+# change 'tests => 1' to 'tests => last_test_to_print';
+
+use Test;
+BEGIN { plan tests => 3 };
+use Locale::US;
+ok(1); # If we made it this far, we're ok.
+
+#########################
+
+# Insert your test code below, the Test::More module is use()ed here so read
+# its man page ( perldoc Test::More ) for help writing this test script.
+
+my $u = new Locale::US;
+
+use Data::Dumper;
+warn Dumper ( [ $u->all_state_codes ], [ $u->all_state_names ] );
+
+
+my $code  = 'AL';
+my $state = 'ALABAMA';
+
+ok (
+    $u->{code2state}{$code}, $state
+   );
+
+ok (
+    $u->{state2code}{$state}, $code
+   );
+
+




More information about the Pkg-perl-cvs-commits mailing list