Project

traveller

0.0
No commit activity in last 3 years
No release in over 3 years
Traveller parses location-based strings and exposes their city, state, zip code, latitude, and longitude. NOTE: Latitude and Longitude support is coming.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

Build Status

Traveller

Traveller is a gem that lets you easily parse strings for location attributes. A simple example:

traveller = Traveller.new("kent ohio 44240")

traveller.state
>> "Ohio"

traveller.state_abbreviation
>> "OH"

traveller.city
>> "Kent"

traveller.zip
>> "44240"

Parsing more complex locations:

traveller = Traveller.new("South Canton, OH 44701-1234")

traveller.state
>> "Ohio"

traveller.zip
>> "44701"

traveller = Traveller.new("new york new york")

traveller.state_abbreviation
>> "NY"

Traveller supports many different types of inputs, and you can check out the tests to see what works.

Note: latitude and longitude support is coming.

Release notes

0.0.010 release ("Stet")
Updated references to GitHub after changing my username.

0.0.007 release ("Bond, James Bond")
This update fixes an issue where albany ny would be parsed as city: alban, where Traveller stripped the ny off the end. Updated the regex to only strip words with spaces before and after the target word.