united_states 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -1
- data/CHANGELOG.md +52 -0
- data/README.md +44 -6
- data/bin/circle_ci/setup +15 -0
- data/bin/circle_ci/test +9 -0
- data/bin/document +4 -0
- data/bin/setup +3 -0
- data/bin/test +5 -1
- data/circle.yml +2 -2
- data/lib/united_states.rb +1 -1
- data/lib/united_states/state/postal_code.rb +4 -2
- data/lib/united_states/version.rb +1 -1
- data/united_states.gemspec +1 -0
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7531af5d720089625de67dd1edf5b7021311b226
|
4
|
+
data.tar.gz: b7dc7fb19fa7609d05e8e5381d6ba005170862fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ff7b6b550c343b2096f949d51fcba2c7bb5033bc2b66920d0fb043eb88d7406af0f73da6b402da2d14fcd972966d97b223d95a4a8339d7df521305f89725aa7
|
7
|
+
data.tar.gz: fd2f499ed1c80aeb244e1f242decc77386760b6a93ae0baa0989a2cafe5e600de4be28335052c085ec1af033f18f0db6fdb44226328d9c2c4c6059a4e4c7308c
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
|
+
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
|
+
|
7
|
+
__Change Groups__:
|
8
|
+
|
9
|
+
`Added`, `Changed`, `Deprecated`, `Fixed`, `Removed`, `Security`
|
10
|
+
|
11
|
+
## [Unreleased]
|
12
|
+
|
13
|
+
## [1.1.1] - 2017-02-18
|
14
|
+
### Added
|
15
|
+
- `CircleCI` now tests against `Ruby` versions `2.1.10`, `2.2.6`, `2.3.3`, `2.4.0`.
|
16
|
+
- [`CHANGELOG.md`](CHANGELOG.md) following http://keepachangelog.com/en/0.3.0/.
|
17
|
+
- `./bin/circle_ci` for all `CircleCI`-specific scripts.
|
18
|
+
|
19
|
+
### Changed
|
20
|
+
- `./bin/` scripts are verbose.
|
21
|
+
- `README.md` `Development` section expanded with branching details.
|
22
|
+
- `README.md` `Deployment` section expanded with branching details.
|
23
|
+
|
24
|
+
## [1.1.0] - 2017-02-11
|
25
|
+
### Added
|
26
|
+
- `UnitedStates.find_by_name(name)` to find a `UnitedStates::State::Designation` with matching name.
|
27
|
+
- `UnitedStates.find_by_postal_code(postal_code)` to find a `UnitedStates::State::Designation` with matching postal code.
|
28
|
+
- `UnitedStates.[](name_or_postal_code)` to find a `UnitedStates::State::Designation` with matching name or postal code.
|
29
|
+
- Support for `Symbol` values as "name" or "postal code" parameters.
|
30
|
+
|
31
|
+
### Changed
|
32
|
+
- All references of `abbreviation` to `postal code`.
|
33
|
+
- `UnitedStates.abbreviations` -> `.postal_codes`
|
34
|
+
- `UnitedStates::State::Abbreviation` -> `UnitedStates::State::PostalCode`.
|
35
|
+
- `UnitedStates::State::Designation#abbreviation` -> `#postal_code`
|
36
|
+
|
37
|
+
|
38
|
+
## [1.0.2] - 2017-02-09
|
39
|
+
### Added
|
40
|
+
- Usage examples to `README.md`.
|
41
|
+
|
42
|
+
## [1.0.1] - 2017-02-08
|
43
|
+
### Fixed
|
44
|
+
- GitHub repo url in `README.md`.
|
45
|
+
|
46
|
+
## [1.0.0] - 2017-02-08
|
47
|
+
### Added
|
48
|
+
- `UnitedStates` module.
|
49
|
+
- `UnitedStates::State::Abbreviation` class.
|
50
|
+
- `UnitedStates::State::Designation` class.
|
51
|
+
- `UnitedStates::State::Name` class.
|
52
|
+
- `./bin/document` to generate documentation.
|
data/README.md
CHANGED
@@ -20,6 +20,12 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install united_states
|
22
22
|
|
23
|
+
`united_states` is tested against the following [stable `ruby` versions](https://www.ruby-lang.org/en/downloads/):
|
24
|
+
* MRI 2.1.10
|
25
|
+
* MRI 2.2.6
|
26
|
+
* MRI 2.3.3
|
27
|
+
* MRI 2.4.0
|
28
|
+
|
23
29
|
## Usage
|
24
30
|
|
25
31
|
```ruby
|
@@ -41,19 +47,51 @@ UnitedStates['car']
|
|
41
47
|
|
42
48
|
## Development
|
43
49
|
|
44
|
-
|
45
|
-
|
46
|
-
|
50
|
+
### Branching
|
51
|
+
|
52
|
+
Checkout the repo. If making a `hot_fix` branch, branch from
|
53
|
+
`master`. If making a `bug_fix`/`chore`/`enhancement` branch,
|
54
|
+
branch from
|
55
|
+
[`development`](https://github.com/kWhittington/united_states/tree/develop).
|
56
|
+
Be sure to update [`CHANGELOG.md`](CHANGELOG.md)
|
57
|
+
(see http://keepachangelog.com/en/0.3.0/) with your changes.
|
58
|
+
|
59
|
+
### Setup
|
60
|
+
Run `./bin/setup` to install dependencies.
|
61
|
+
|
62
|
+
### Testing
|
63
|
+
Run `./bin/test` to run code quality checks and tests.
|
64
|
+
|
65
|
+
### Documenting
|
66
|
+
Run `./bin/document` to generate `doc/` and open
|
67
|
+
[`doc/index.html`](doc/index.html)
|
47
68
|
to view the documentation. See
|
48
69
|
http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md for
|
49
70
|
documentation syntax.
|
50
71
|
|
51
|
-
|
72
|
+
### Seat-of-the-Pants Testing
|
73
|
+
Run `./bin/console` for an interactive prompt that will allow
|
52
74
|
you to experiment.
|
53
75
|
|
76
|
+
### Manual installation
|
54
77
|
To install this gem onto your local machine, run `bundle exec rake
|
55
|
-
install`.
|
56
|
-
|
78
|
+
install`.
|
79
|
+
|
80
|
+
### Deployment
|
81
|
+
To release a new version, you must first have authorization to push
|
82
|
+
to `rubygems`. If so, make a new
|
83
|
+
`chore/#ISSUE_NUMBER_update_version_to_MAJOR_MINOR_PATCH`, update
|
84
|
+
`UnitedStates::VERSION` number (per
|
85
|
+
[Semantic Versioning](http://semver.org/)) in
|
86
|
+
[`lib/united_states/version.rb`](lib/united_states/version.rb),
|
87
|
+
change the `Unreleased` section of `CHANGELOG.md` to the new version
|
88
|
+
number, and then make a pull request merging to `development`.
|
89
|
+
|
90
|
+
After `development` has been updated with the new version number,
|
91
|
+
make a pull request merging the new changes to `master`.
|
92
|
+
|
93
|
+
Once `master` has been updated, checkout the latest `master`
|
94
|
+
and run `bundle exec rake release`, which will create a
|
57
95
|
git tag for the version, push git commits and tags, and push the
|
58
96
|
`.gem` file to [rubygems.org](https://rubygems.org).
|
59
97
|
|
data/bin/circle_ci/setup
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
IFS=$'\n\t'
|
4
|
+
set -vx
|
5
|
+
|
6
|
+
gem install bundler
|
7
|
+
wget https://rubygems.org/rubygems/rubygems-2.6.10.tgz
|
8
|
+
tar xzvf rubygems-2.6.10.tgz
|
9
|
+
cd rubygems-2.6.10
|
10
|
+
ruby setup.rb
|
11
|
+
cd ..
|
12
|
+
rm -rf rubygems-2.6.10
|
13
|
+
bundle install
|
14
|
+
|
15
|
+
# Do any other automated setup that you need to do here
|
data/bin/circle_ci/test
ADDED
data/bin/document
CHANGED
data/bin/setup
CHANGED
data/bin/test
CHANGED
data/circle.yml
CHANGED
data/lib/united_states.rb
CHANGED
@@ -9,7 +9,7 @@ module UnitedStates
|
|
9
9
|
# Thrown when someone attempts to search for a state with
|
10
10
|
# the wrong name or postal code.
|
11
11
|
class NoDesignationFoundError < StandardError
|
12
|
-
DEFAULT_MESSAGE = 'No State was found.'
|
12
|
+
DEFAULT_MESSAGE = 'No State was found.'.freeze
|
13
13
|
|
14
14
|
def initialize(message = DEFAULT_MESSAGE)
|
15
15
|
super(message)
|
@@ -7,7 +7,8 @@ module UnitedStates
|
|
7
7
|
# Thrown when someone attempts to make a PostalCode instance
|
8
8
|
# from a string longer than 2 characters.
|
9
9
|
class StringTooLongError < StandardError
|
10
|
-
DEFAULT_MESSAGE = 'string too long, postal code must be
|
10
|
+
DEFAULT_MESSAGE = 'string too long, postal code must be '\
|
11
|
+
'2 characters'.freeze
|
11
12
|
|
12
13
|
def initialize(message = DEFAULT_MESSAGE)
|
13
14
|
super(message)
|
@@ -17,7 +18,8 @@ module UnitedStates
|
|
17
18
|
# Thrown when someone attempts to make a PostalCode instance
|
18
19
|
# from a string shorter than 2 characters.
|
19
20
|
class StringTooShortError < StandardError
|
20
|
-
DEFAULT_MESSAGE = 'string too short, postal codes must be
|
21
|
+
DEFAULT_MESSAGE = 'string too short, postal codes must be '\
|
22
|
+
'2 characters'.freeze
|
21
23
|
|
22
24
|
def initialize(message = DEFAULT_MESSAGE)
|
23
25
|
super(message)
|
data/united_states.gemspec
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency 'pry-coolline'
|
30
30
|
spec.add_development_dependency 'rake', '~> 10.0'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
32
|
+
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.2'
|
32
33
|
spec.add_development_dependency 'rubocop'
|
33
34
|
spec.add_development_dependency 'rubocop-rspec'
|
34
35
|
spec.add_development_dependency 'yard'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: united_states
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Whittington
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec_junit_formatter
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.2'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rubocop
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,11 +160,14 @@ files:
|
|
146
160
|
- ".gitignore"
|
147
161
|
- ".rubocop.yml"
|
148
162
|
- ".ruby-gemset"
|
163
|
+
- CHANGELOG.md
|
149
164
|
- CODE_OF_CONDUCT.md
|
150
165
|
- Gemfile
|
151
166
|
- LICENSE
|
152
167
|
- README.md
|
153
168
|
- Rakefile
|
169
|
+
- bin/circle_ci/setup
|
170
|
+
- bin/circle_ci/test
|
154
171
|
- bin/console
|
155
172
|
- bin/document
|
156
173
|
- bin/setup
|
@@ -182,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
199
|
version: '0'
|
183
200
|
requirements: []
|
184
201
|
rubyforge_project:
|
185
|
-
rubygems_version: 2.
|
202
|
+
rubygems_version: 2.6.10
|
186
203
|
signing_key:
|
187
204
|
specification_version: 4
|
188
205
|
summary: The United States names and postal codes.
|