Skip Menu |

This queue is for tickets about the Data-Faker CPAN distribution.

Report information
The Basics
Id: 65311
Status: resolved
Priority: 0/
Queue: Data-Faker

People
Owner: WSHELDAHL [...] cpan.org
Requestors: ROKR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.07
Fixed in: (no value)



The SYNOPSIS uses methods that aren't defined/available for use. Namely, ->city, ->zip, ->state
Subject: city method
RT-Send-CC: email [...] jasonkohles.com, cpan [...] jasonkohles.com
On Mon Jan 31 16:45:04 2011, ROKR wrote: Show quoted text
> The SYNOPSIS uses methods that aren't defined/available for use. > > Namely, ->city, ->zip, ->state
The attached patch adds a 'city' method with a sampling of US cities. For zip and state, I've used the us_state_abbr and us_zip_code methods.
Subject: data_faker_city.patch
diff --git a/lib/Data/Faker/StreetAddress.pm b/lib/Data/Faker/StreetAddress.pm index 518801b..7396da3 100644 --- a/lib/Data/Faker/StreetAddress.pm +++ b/lib/Data/Faker/StreetAddress.pm @@ -1,5 +1,5 @@ package Data::Faker::StreetAddress; -use vars qw($VERSION); $VERSION = '0.07'; +use vars qw($VERSION); $VERSION = '0.08'; use base 'Data::Faker'; use Data::Faker::Name; @@ -181,6 +181,332 @@ __PACKAGE__->register_plugin( =back +=item city + +Return a random city, taken from a list of larger cities in several U.S. states. + +=cut + +__PACKAGE__->register_plugin( + city => [ + 'Agoura Hills', + 'Akron', + 'Alameda', + 'Alhambra', + 'Aliso Viejo', + 'Anaheim', + 'Anchorage', + 'Apple Valley', + 'Arcadia', + 'Artesia', + 'Ashland', + 'Athens', + 'Atwater', + 'Auburn', + 'Avalon', + 'Azusa', + 'Bakersfield', + 'Baldwin Park', + 'Barrow', + 'Bell Gardens', + 'Bell', + 'Bellflower', + 'Bentonville', + 'Berkeley', + 'Bessemer', + 'Beverly Hills', + 'Birmingham', + 'Bloomington', + 'Blythe', + 'Bowling Green', + 'Bradbury', + 'Brea', + 'Buena Park', + 'Burbank', + 'Burlingame', + 'Calabasas', + 'Canton', + 'Carson', + 'Cerritos', + 'Chandler', + 'Chico', + 'Chino Hills', + 'Chino', + 'Chula Vista', + 'Cincinnati', + 'Citrus Heights', + 'City of Industry', + 'Claremont', + 'Cleveland', + 'Columbus', + 'Commerce', + 'Compton', + 'Concord', + 'Corona', + 'Costa Mesa', + 'Covina', + 'Covington', + 'Crown Point', + 'Cudahy', + 'Culver City', + 'Cypress', + 'Daly City', + 'Dana Point', + 'Danville', + 'Dayton', + 'Decatur', + 'Delta Junction', + 'Demopolis', + 'Diamond Bar', + 'Dothan', + 'Downey', + 'Duarte', + 'El Cerrito', + 'El Monte', + 'El Segundo', + 'Elkhart', + 'Escondido', + 'Eufaula', + 'Eureka', + 'Evansville', + 'Fairbanks', + 'Fairfield', + 'Fayetteville', + 'Flagstaff', + 'Florence', + 'Florence', + 'Fontana', + 'Forrest City', + 'Fort Smith', + 'Fort Wayne', + 'Fountain Valley', + 'Frankfort', + 'Fremont', + 'Fresno', + 'Fullerton', + 'Gadsden', + 'Garden Grove', + 'Gardena', + 'Gary', + 'Gilbert', + 'Glendale', + 'Glendale', + 'Glendora', + 'Gulf Shores', + 'Half Moon Bay', + 'Hamilton', + 'Hammond', + 'Hawaiian Gardens', + 'Hawthorne', + 'Hayward', + 'Hermosa Beach', + 'Hidden Hills', + 'Hollister', + 'Hollywood', + 'Homer', + 'Hoover', + 'Hope', + 'Hopkinsville', + 'Hot Springs', + 'Huntington Beach', + 'Huntington Park', + 'Huntsville', + 'Indianapolis', + 'Indio', + 'Inglewood', + 'Irvine', + 'Irwindale', + 'Jasper', + 'Jeffersontown', + 'Jonesboro', + 'Juneau', + 'Kent', + 'Ketchikan', + 'Kettering', + 'Kokomo', + 'La Cañada Flintridge', + 'La Habra Heights', + 'La Habra', + 'La Jolla', + 'La Mirada', + 'La Palma', + 'La Puente', + 'La Verne', + 'Lafayette', + 'Laguna Beach', + 'Laguna Hills', + 'Laguna Niguel', + 'Laguna Woods', + 'Lake Forest', + 'Lakewood', + 'Lakewood', + 'Lancaster', + 'Lawndale', + 'Lexington', + 'Lima', + 'Little Rock', + 'Lodi', + 'Lomita', + 'Long Beach', + 'Los Alamitos', + 'Los Angeles', + 'Louisville', + 'Lynwood', + 'Malibu', + 'Manhattan Beach', + 'Marana', + 'Maywood', + 'Mentor', + 'Mentor-on-the-Lake', + 'Merced', + 'Mesa', + 'Michigan City', + 'Middletown', + 'Mission Viejo', + 'Mobile', + 'Modesto', + 'Monrovia', + 'Montebello', + 'Monterey Park', + 'Monterey', + 'Montgomery', + 'Moraga', + 'Moreno Valley', + 'Muncie', + 'Murray', + 'Murrieta', + 'Nenana', + 'Newport Beach', + 'Nogales', + 'Nome', + 'North Little Rock', + 'North Pole', + 'Norwalk', + 'Oakland', + 'Ontario', + 'Orange', + 'Oro Valley', + 'Owensboro', + 'Oxford', + 'Oxnard', + 'Paducah', + 'Palm Springs', + 'Palmdale', + 'Palo Alto', + 'Palos Verdes Estates', + 'Paramount', + 'Parma', + 'Pasadena', + 'Peoria', + 'Phenix City', + 'Phoenix', + 'Pico Rivera', + 'Pine Bluff', + 'Placentia', + 'Pomona', + 'Prescott', + 'Rancho Cordova', + 'Rancho Cucamonga', + 'Rancho Palos Verdes', + 'Rancho Santa Margarita', + 'Redding', + 'Redlands', + 'Redondo Beach', + 'Rialto', + 'Richmond', + 'Riverside', + 'Rohnert Park', + 'Rolling Hills Estates', + 'Rolling Hills', + 'Rosemead', + 'Roseville', + 'Sacramento', + 'Sahuarita', + 'Salinas', + 'San Bernardino', + 'San Clemente', + 'San Diego', + 'San Dimas', + 'San Fernando', + 'San Francisco', + 'San Gabriel', + 'San Jose', + 'San Juan Capistrano', + 'San Luis Obispo', + 'San Marino', + 'San Mateo', + 'San Rafael', + 'Santa Ana', + 'Santa Barbara', + 'Santa Clara', + 'Santa Clarita', + 'Santa Cruz', + 'Santa Fe Springs', + 'Santa Monica', + 'Santa Rosa', + 'Scottsdale', + 'Seal Beach', + 'Selma', + 'Seward', + 'Sierra Madre', + 'Sierra Vista', + 'Signal Hill', + 'Simi Valley', + 'Sitka', + 'Sonoma', + 'South Bend', + 'South El Monte', + 'South Gate', + 'South Pasadena', + 'Springdale', + 'Springfield', + 'Stanton', + 'Steubenville', + 'Stockton', + 'Sunnyvale', + 'Sutter Creek', + 'Temecula', + 'Tempe', + 'Temple City', + 'Terre Haute', + 'Texarkana', + 'Thousand Oaks', + 'Tok', + 'Toledo', + 'Torrance', + 'Troy', + 'Tucson', + 'Tuscaloosa', + 'Tuskegee', + 'Tustin', + 'Two Rivers', + 'Union City', + 'Valdez', + 'Valencia', + 'Vallejo', + 'Valparaiso', + 'Ventura', + 'Vernon', + 'Villa Park', + 'Vincennes', + 'Visalia', + 'Walnut', + 'West Covina', + 'West Hollywood', + 'West Lafayette', + 'West Memphis', + 'Westlake Village', + 'Westminster', + 'Whittier', + 'Wynne', + 'Yorba Linda', + 'Youngstown', + 'Yuma', + 'Zanesville', + ], +); + + =head1 SEE ALSO L<Data::Faker> diff --git a/t/Data-Faker-StreetAddress.t b/t/Data-Faker-StreetAddress.t index 23d2b30..08b88f2 100644 --- a/t/Data-Faker-StreetAddress.t +++ b/t/Data-Faker-StreetAddress.t @@ -1,4 +1,4 @@ -use Test::More tests => 14; +use Test::More tests => 15; BEGIN { use_ok('Data::Faker') }; my $faker = Data::Faker->new('StreetAddress'); diff --git a/t/Data-Faker.t b/t/Data-Faker.t index eaadaaf..75d8080 100644 --- a/t/Data-Faker.t +++ b/t/Data-Faker.t @@ -1,4 +1,4 @@ -use Test::More tests => 44; +use Test::More tests => 45; BEGIN { use_ok('Data::Faker') }; my $faker = Data::Faker->new();
Subject: Fixed in 0.08
RT-Send-CC: email [...] jasonkohles.com, cpan [...] jasonkohles.com
Release 0.08 of Data::Faker resolved the issue you reported. There is now a city method that returns a random city name, and the rest of the synopsis should be in sync with the code now as well.