The names and postal codes of each United States of America State.
Add this line to your application's Gemfile
:
gem 'united_states'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install united_states
united_states
is tested against the following stable ruby
versions:
- MRI 2.1.10
- MRI 2.2.10
- MRI 2.3.8
- MRI 2.4.4
- MRI 2.5.3
- MRI 2.6.0
require 'united_states'
UnitedStates.all
# => [#<UnitedStates::State::Designation...@string="WY">]
UnitedStates.names
#=> [#<UnitedStates::State::Name...@string="Wyoming">]
UnitedStates.postal_codes
#=> [#<UnitedStates::State::PostalCode...@string="WY"]
UnitedStates[:LA]
# => [#<UnitedStates::State::Designation...@string="LA">]
UnitedStates['mississippi']
# => [#<UnitedStates::State::Designation...@string="MS">]
UnitedStates['car']
# => UnitedStates::NoDesignationFoundError
Checkout the repo. If making a hot_fix
branch, branch from
master
. If making a bug_fix
/chore
/enhancement
branch,
branch from
development
.
Be sure to update CHANGELOG.md
(see http://keepachangelog.com/en/0.3.0/) with your changes.
Run ./bin/setup
to install dependencies.
Run ./bin/test
to run code quality checks and tests.
Run ./bin/document
to generate doc/
and open
doc/index.html
to view the documentation. See
http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md for
documentation syntax.
Run ./bin/console
for an interactive prompt that will allow
you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
To release a new version, you must first have authorization to push
to rubygems
. If so, make a new
chore/#ISSUE_NUMBER_update_version_to_MAJOR_MINOR_PATCH
, update
UnitedStates::VERSION
number (per
Semantic Versioning) in
lib/united_states/version.rb
,
change the Unreleased
section of CHANGELOG.md
to the new version
number, and then make a pull request merging to development
.
After development
has been updated with the new version number,
make a pull request merging the new changes to master
.
Once master
has been updated, checkout the latest master
and run bundle exec rake release
, which will create a
git tag for the version, push git commits and tags, and push the
.gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/kWhittington/united_states. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.