No commit activity in last 3 years
No release in over 3 years
Smartly capitalize US & Canadian addresses
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.1
~> 12.3
~> 3.8
~> 0.72
 Project Readme

Address Titlecase

Build Status Gem Version

Titleize US and Canadian addresses so that states, directions, and other abbreviations that would normally be titlecased by String#titleize remain uppercase.

> "123 SESAME ST SE, SALEM, OR 97301".address_titlecase
=> "123 Sesame St SE, Salem, OR 97301"

Options

Customize transformations by providing an overrides argument where the keys denote the words/abbreviations that should be mapped to specific values.

> "123 SESAME ST SE, SALEM, OR 97301".address_titlecase(overrides: { 'ST' => 'ST', 'SE' => 'Se' })
=> "123 Sesame ST Se, Salem, OR 97301"

address_titlecase is also aliased as address_titleize.

Installation

Add this line to your application's Gemfile:

gem 'address_titlecase'

And then execute:

$ bundle

Or install it yourself as:

$ gem install address_titlecase

License

The gem is available as open source under the terms of the MIT License.