fips_lookup 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +14 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +14 -0
  6. data/Gemfile.lock +69 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +198 -0
  9. data/Rakefile +12 -0
  10. data/lib/data/county/AK.csv +29 -0
  11. data/lib/data/county/AL.csv +67 -0
  12. data/lib/data/county/AR.csv +75 -0
  13. data/lib/data/county/AS.csv +5 -0
  14. data/lib/data/county/AZ.csv +15 -0
  15. data/lib/data/county/CA.csv +58 -0
  16. data/lib/data/county/CO.csv +64 -0
  17. data/lib/data/county/CT.csv +8 -0
  18. data/lib/data/county/DC.csv +1 -0
  19. data/lib/data/county/DE.csv +3 -0
  20. data/lib/data/county/FL.csv +67 -0
  21. data/lib/data/county/GA.csv +159 -0
  22. data/lib/data/county/GU.csv +1 -0
  23. data/lib/data/county/HI.csv +5 -0
  24. data/lib/data/county/IA.csv +99 -0
  25. data/lib/data/county/ID.csv +44 -0
  26. data/lib/data/county/IL.csv +102 -0
  27. data/lib/data/county/IN.csv +92 -0
  28. data/lib/data/county/KS.csv +105 -0
  29. data/lib/data/county/KY.csv +120 -0
  30. data/lib/data/county/LA.csv +64 -0
  31. data/lib/data/county/MA.csv +14 -0
  32. data/lib/data/county/MD.csv +24 -0
  33. data/lib/data/county/ME.csv +16 -0
  34. data/lib/data/county/MI.csv +83 -0
  35. data/lib/data/county/MN.csv +87 -0
  36. data/lib/data/county/MO.csv +115 -0
  37. data/lib/data/county/MP.csv +4 -0
  38. data/lib/data/county/MS.csv +82 -0
  39. data/lib/data/county/MT.csv +56 -0
  40. data/lib/data/county/NC.csv +100 -0
  41. data/lib/data/county/ND.csv +53 -0
  42. data/lib/data/county/NE.csv +93 -0
  43. data/lib/data/county/NH.csv +10 -0
  44. data/lib/data/county/NJ.csv +21 -0
  45. data/lib/data/county/NM.csv +33 -0
  46. data/lib/data/county/NV.csv +17 -0
  47. data/lib/data/county/NY.csv +62 -0
  48. data/lib/data/county/OH.csv +88 -0
  49. data/lib/data/county/OK.csv +77 -0
  50. data/lib/data/county/OR.csv +36 -0
  51. data/lib/data/county/PA.csv +67 -0
  52. data/lib/data/county/PR.csv +78 -0
  53. data/lib/data/county/RI.csv +5 -0
  54. data/lib/data/county/SC.csv +46 -0
  55. data/lib/data/county/SD.csv +66 -0
  56. data/lib/data/county/TN.csv +95 -0
  57. data/lib/data/county/TX.csv +254 -0
  58. data/lib/data/county/UM.csv +1 -0
  59. data/lib/data/county/UT.csv +29 -0
  60. data/lib/data/county/VA.csv +134 -0
  61. data/lib/data/county/VI.csv +3 -0
  62. data/lib/data/county/VT.csv +14 -0
  63. data/lib/data/county/WA.csv +39 -0
  64. data/lib/data/county/WI.csv +72 -0
  65. data/lib/data/county/WV.csv +55 -0
  66. data/lib/data/county/WY.csv +23 -0
  67. data/lib/data/state.csv +57 -0
  68. data/lib/fips_lookup/version.rb +5 -0
  69. data/lib/fips_lookup.rb +91 -0
  70. data/sig/fips_lookup.rbs +4 -0
  71. metadata +168 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3f3aa5d2aca2ae20b064754d8c55a61a11acafc1f7b091844fa1336172012c01
4
+ data.tar.gz: 5ec480edf9b9ae1d5a0dcac2fa7c32261d414280ffb2302dc3be74695a80587b
5
+ SHA512:
6
+ metadata.gz: 76d3156628234f4b0e788c1de6ea2599c7771872ad60e38572ea7a1610b19dd72a9a937b3a021f8663da894b63200b25374e65dca12e0f389b62f3c398f5321b
7
+ data.tar.gz: a1fd054a613e41d324ee5780fd5f975212d86d5846b836f2c8736643d08875b84bb2076e2fe68406b8c74c9af8be09b7ec4f26c08bd2eb78699005ed8c360fe6
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,14 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+ NewCops: enable
4
+
5
+ Style/StringLiterals:
6
+ Enabled: true
7
+ EnforcedStyle: double_quotes
8
+
9
+ Style/StringLiteralsInInterpolation:
10
+ Enabled: true
11
+ EnforcedStyle: double_quotes
12
+
13
+ Layout/LineLength:
14
+ Max: 140
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at erik.barroso@primary.health. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in fips_lookup.gemspec
6
+ gemspec
7
+
8
+ gem "csv", "~> 3.2"
9
+
10
+ gem "rake", "~> 13.0"
11
+
12
+ gem "rspec", "~> 3.2"
13
+
14
+ gem "rubocop", "~> 1.21"
data/Gemfile.lock ADDED
@@ -0,0 +1,69 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ fips_lookup (0.1.0)
5
+ csv (~> 3.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ csv (3.2.8)
12
+ diff-lcs (1.5.0)
13
+ json (2.6.2)
14
+ nokogiri (1.16.2-arm64-darwin)
15
+ racc (~> 1.4)
16
+ parallel (1.22.1)
17
+ parser (3.1.2.0)
18
+ ast (~> 2.4.1)
19
+ racc (1.6.0)
20
+ rainbow (3.1.1)
21
+ rake (13.0.6)
22
+ regexp_parser (2.5.0)
23
+ rexml (3.2.5)
24
+ rspec (3.11.0)
25
+ rspec-core (~> 3.11.0)
26
+ rspec-expectations (~> 3.11.0)
27
+ rspec-mocks (~> 3.11.0)
28
+ rspec-core (3.11.0)
29
+ rspec-support (~> 3.11.0)
30
+ rspec-expectations (3.11.0)
31
+ diff-lcs (>= 1.2.0, < 2.0)
32
+ rspec-support (~> 3.11.0)
33
+ rspec-mocks (3.11.1)
34
+ diff-lcs (>= 1.2.0, < 2.0)
35
+ rspec-support (~> 3.11.0)
36
+ rspec-support (3.11.0)
37
+ rubocop (1.31.2)
38
+ json (~> 2.3)
39
+ parallel (~> 1.10)
40
+ parser (>= 3.1.0.0)
41
+ rainbow (>= 2.2.2, < 4.0)
42
+ regexp_parser (>= 1.8, < 3.0)
43
+ rexml (>= 3.2.5, < 4.0)
44
+ rubocop-ast (>= 1.18.0, < 2.0)
45
+ ruby-progressbar (~> 1.7)
46
+ unicode-display_width (>= 1.4.0, < 3.0)
47
+ rubocop-ast (1.18.0)
48
+ parser (>= 3.1.1.0)
49
+ ruby-progressbar (1.11.0)
50
+ rubyzip (2.3.2)
51
+ simple_xlsx_reader (1.0.5)
52
+ nokogiri
53
+ rubyzip
54
+ unicode-display_width (2.2.0)
55
+
56
+ PLATFORMS
57
+ arm64-darwin-21
58
+ arm64-darwin-22
59
+
60
+ DEPENDENCIES
61
+ csv (~> 3.2)
62
+ fips_lookup!
63
+ rake (~> 13.0)
64
+ rspec (~> 3.2)
65
+ rubocop (~> 1.21)
66
+ simple_xlsx_reader
67
+
68
+ BUNDLED WITH
69
+ 2.5.6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Erik Barroso
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,198 @@
1
+ # FipsLookup
2
+
3
+ ## Overview
4
+
5
+ FipsLookup is a gem that functions as a lookup used to identify county and state FIPS codes.
6
+
7
+ What are FIPS codes? The United States Federal Communications Commission (FCC) [says:](https://transition.fcc.gov/oet/info/maps/census/fips/fips.txt)
8
+
9
+ > Federal Information Processing System (FIPS) Codes for States and Counties
10
+ >
11
+ > FIPS codes are numbers which uniquely identify geographic areas. The number of
12
+ digits in FIPS codes vary depending on the level of geography. State-level FIPS
13
+ codes have two digits, county-level FIPS codes have five digits of which the
14
+ first two are the FIPS code of the state to which the county belongs.
15
+
16
+ _Note:_ FIPS codes are updated by the US census department they can be seen and accessed [here](https://www.census.gov/library/reference/code-lists/ansi.html).
17
+
18
+ <br>
19
+
20
+ **Interesting challenge:** <br>
21
+ Multiple states can have the same county name — 16 states have a "Wayne County". This means a state & county pair is required to lookup and return the proper FIPS code.
22
+ This gem utilizes memoization to increase lookup efficiency to csv files without adding complexity to your app.
23
+
24
+ ## Installation
25
+
26
+ Add this line to your application's Gemfile:
27
+
28
+ ```ruby
29
+ gem 'fips_lookup'
30
+ ```
31
+
32
+ And then execute:
33
+
34
+ $ bundle install
35
+
36
+ Or install it yourself as:
37
+
38
+ $ gem install fips_lookup
39
+
40
+ ## Usage
41
+ <br>
42
+
43
+ ### County info from lookup: [.county(state_param: "state", county_name: "county name", _return_nil: false_)](/fips_lookup/lib/fips_lookup.rb?#L24)
44
+
45
+ Find County specific details using memoized hash state and county input. [ Returns state code, county fips, county name, and county class codes ]
46
+
47
+ Input the state name and county name and return the corresponding 5 digit FIPS code:
48
+ ```
49
+ FipsLookup.county(state_param: "AL", county_name: "Autauga County") # => {:state_code=>"AL", :fips=>"01001", :name=>"Autauga County", :class_code=>"H1"}
50
+ ```
51
+
52
+ * `state_param` - (String) flexible - able to find the state using its' 2 letter abbreviation ("AL"), 2 digit FIPS number ("01"), state name ("Alabama"), or the state ANSI code ("01779775").
53
+ * `county_name` - (String) must match spelling set by US Census Bureau, [resource library](https://www.census.gov/library/reference/code-lists/ansi.html)
54
+ — "Autauga County" can be found, "Autauga" can not be found.
55
+ * `return_nil` - (Boolean) is an optional parameter that when used overrides any Errors from input and returns an empty hash `{}`.
56
+ * Ex: `FipsLookup.county(state_param: "AL", county_name: "Autauga", return_nil: true) # => {}`
57
+
58
+ * Ex: Access the [:fips] symbol after a lookup `FipsLookup.county(state_param: "AL", county_name: "Autauga", return_nil: true)[:fips] # => nil`
59
+
60
+ <br>
61
+
62
+ **How does it work?:**
63
+
64
+ Class attribute hash: [`@county_fips = { ["state_code", "county name"] => {:state_code, :fips, :name, :class_code} }`](/fips_lookup/lib/fips_lookup.rb?#L21)
65
+
66
+ The `county_fips` hash is built of key value pairs that grows as the `.county` method is used. Calls to `county` first searches `@county_fips` attribute with `[state_code, county_name]` before opening `.csv` files. Therefore any duplicate calls made to `county` will return the value stored in `@county_fips`. Instance variable lasts the lifespan of the FipsLookup class.
67
+ ```
68
+ FipsLookup.county_fips # => { ["AL", "Autauga County"] => {:state_code=>"AL", :fips=>"01001", :name=>"Autauga County", :class_code=>"H1"} }
69
+ ```
70
+ <br>
71
+ <hr>
72
+
73
+ ### State / County lookup using FIPS code [.fips_county(fips: "fips", return_nil: _return_nil=false_)](/fips_lookup/lib/fips_lookup.rb?#L38)
74
+
75
+ Input the 5 digit FIPS code for a county and return the county name and state name in an Array:
76
+ ```
77
+ FipsLookup.fips_county(fips: "01001") # => ["Autauga County", "AL"]
78
+ ```
79
+
80
+ * `fips` - (String) must be a 5 character string of numbers ex: "01001".
81
+ * `return_nil` - (Boolean) is an optional parameter that when used overrides any Errors from input and returns `nil`.
82
+ * Ex: `FipsLookup.fips_county(fips: "03000", return_nil: true) # => nil`
83
+
84
+ <br>
85
+ <hr>
86
+
87
+ ### State info from lookup [.state(state_param: "state", _return_nil: false_)](/fips_lookup/lib/fips_lookup.rb?#L33)
88
+
89
+ Using state information input return a dictionary of values for keys fips, state code, state name, state ansi code.
90
+
91
+ ```
92
+ FipsLookup.state(state_param: "01") # => {:fips=>"01", :code=>"AL", :name=>"Alabama", :ansi=>"01779775"}
93
+ ```
94
+
95
+ * `state_param` - (String) flexible - able to find the state using its' 2 letter abbreviation ("AL"), 2 digit FIPS number ("01"), state name ("Alabama"), or the state ANSI code ("01779775").
96
+ * `return_nil` - (Boolean) is an optional parameter that when used overrides any Errors from input and returns an empty hash `{}`.
97
+
98
+ * `.state` functions similarly to the `.county` method in how it uses a memoized hash `@state_fips` to store state parameter lookups and return values before searching `state.csv` for more.
99
+
100
+ **State code lookup hash** [`STATE_CODES["state code"] # => "fips code"`](/fips_lookup/lib/fips_lookup.rb?#L8)
101
+ Can also be used for quick lookup translation between state 2-character abbreviations and state 2-digit FIPS code.
102
+ ```
103
+ FipsLookup::STATE_CODES["AL"] #=> "01"
104
+ FipsLookup::STATE_CODES.key("01") # => "AL"
105
+ ```
106
+ <br>
107
+ <hr>
108
+
109
+ ### Finding state abbreviation with flexible input [.find_state_code(state_param: "state", _return_nil: false_)](/fips_lookup/lib/fips_lookup.rb?#L52)
110
+
111
+ * `state_param` - (String) flexible - able to find the state using its' 2 letter abbreviation ("AL"), 2 digit FIPS number ("01"), state name ("Alabama"), or the state ANSI code ("01779775").
112
+ * `return_nil` - (Boolean) is an optional parameter that when used overrides any Errors from input and returns nil.
113
+
114
+ ```
115
+ FipsLookup.find_state_code(state_param: "MicHiGan") # => "MI"
116
+ ```
117
+
118
+ <br>
119
+ <hr>
120
+
121
+ ## Accessing county and state `.csv` files in your Rails app
122
+
123
+ Data `csv` files are made accessible incase extra configuration is needed. Here is an example in a Rails application that displays the list of state and county names within a form. This is done by accessing the CSV files included in this gem, examples below are from Rails 7 app called [Build With](https://github.com/3barroso/build_with)
124
+
125
+ ### Path to state.csv file [.state_file](/fips_lookup/lib/fips_lookup.rb?#L64)
126
+
127
+ Display state codes in a select option dropdown by using CSV on the FipsLookup method accessing the state.csv file ( `FipsLookup.state_file #=> "path/to/data/state.csv"` )
128
+
129
+ ```
130
+ # in controller.rb
131
+ @state_options = []
132
+ CSV.foreach(FipsLookup.state_file) do |state_row|
133
+ @state_options << [state_row[2], state_row[1]]
134
+ end
135
+ ```
136
+
137
+ ```
138
+ # in html.erb (within `form_with do |form|` block)
139
+ <%= form.label :state, style: "display: block" %>
140
+ <%= form.select :state, @state_options %>
141
+ ```
142
+
143
+ ### Path to state specific county csv files [.county_file(state_code: "state param")](/fips_lookup/lib/fips_lookup.rb?#L59)
144
+
145
+ Display County name options in a select option dropdown by using CSV on the FipsLookup method accessing the county specific .csv file ( `FipsLookup.county_file(state_code: "MI") #=> "path/to/data/county/MI.csv"` )
146
+
147
+ * `state_param` – strict parameter, must be string abbreviation of State code (suggested usage is to call `.find_state_code` above first)
148
+
149
+ ```
150
+ # in controller.rb
151
+ state_code = address_params[:state] # or use find_state_code from user input
152
+ @county_options = []
153
+ CSV.foreach(FipsLookup.county_file(state_code:)) do |county_row|
154
+ @county_options << county_row[3]
155
+ end
156
+ ```
157
+
158
+ ```
159
+ # in html.erb (within `form_with do |form|` block)
160
+ <%= form.label :county, style: "display: block" %>
161
+ <%= form.select :county, @county_options %>
162
+ ```
163
+
164
+ ## Development
165
+
166
+ Download the repository locally, and from the directory run `bin/setup` to install gem dependencies.
167
+
168
+ Check installation and any changes by running `rspec` to run the tests.
169
+
170
+ Use `bin/console` to open IRB console with FipsLookup gem included and ready to use.
171
+
172
+ To install this gem onto your local machine, run `bundle exec rake install`.
173
+
174
+ To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
175
+
176
+ ### New to Ruby?
177
+ On Mac, follow steps 1 and 2 of [this guide](https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-macos) to install ruby with rbenv using brew.
178
+
179
+ For PC, consult official ruby language [installation guides](https://www.ruby-lang.org/en/documentation/installation/).
180
+
181
+ #### New to this gem?
182
+
183
+ * The main working file is `lib/fips_lookup.rb` with usage examples in the test file: `spec/fips_lookup_spec.rb`
184
+ * [The first pull request](https://github.com/3barroso/fips_lookup/pull/1) contains more details to decisions and considerations when first launching gem.
185
+
186
+
187
+ ## Contributing
188
+
189
+ Bug reports and pull requests are welcome on GitHub at the [FipsLookup repo](https://github.com/3barroso/fips_lookup).
190
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/3barroso/fips_lookup/blob/main/CODE_OF_CONDUCT.md).
191
+
192
+ ## License
193
+
194
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
195
+
196
+ ## Code of Conduct
197
+
198
+ Everyone interacting in the FipsLookup project's codebase, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/3barroso/fips_lookup/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,29 @@
1
+ AK,02,013,Aleutians East Borough,H1
2
+ AK,02,016,Aleutians West Census Area,H5
3
+ AK,02,020,Anchorage Municipality,H6
4
+ AK,02,050,Bethel Census Area,H5
5
+ AK,02,060,Bristol Bay Borough,H1
6
+ AK,02,068,Denali Borough,H1
7
+ AK,02,070,Dillingham Census Area,H5
8
+ AK,02,090,Fairbanks North Star Borough,H1
9
+ AK,02,100,Haines Borough,H1
10
+ AK,02,105,Hoonah-Angoon Census Area,H5
11
+ AK,02,110,Juneau City and Borough,H6
12
+ AK,02,122,Kenai Peninsula Borough,H1
13
+ AK,02,130,Ketchikan Gateway Borough,H1
14
+ AK,02,150,Kodiak Island Borough,H1
15
+ AK,02,164,Lake and Peninsula Borough,H1
16
+ AK,02,170,Matanuska-Susitna Borough,H1
17
+ AK,02,180,Nome Census Area,H5
18
+ AK,02,185,North Slope Borough,H1
19
+ AK,02,188,Northwest Arctic Borough,H1
20
+ AK,02,195,Petersburg Census Area,H5
21
+ AK,02,198,Prince of Wales-Hyder Census Area,H5
22
+ AK,02,220,Sitka City and Borough,H6
23
+ AK,02,230,Skagway Municipality,H1
24
+ AK,02,240,Southeast Fairbanks Census Area,H5
25
+ AK,02,261,Valdez-Cordova Census Area,H5
26
+ AK,02,270,Wade Hampton Census Area,H5
27
+ AK,02,275,Wrangell City and Borough,H1
28
+ AK,02,282,Yakutat City and Borough,H1
29
+ AK,02,290,Yukon-Koyukuk Census Area,H5
@@ -0,0 +1,67 @@
1
+ AL,01,001,Autauga County,H1
2
+ AL,01,003,Baldwin County,H1
3
+ AL,01,005,Barbour County,H1
4
+ AL,01,007,Bibb County,H1
5
+ AL,01,009,Blount County,H1
6
+ AL,01,011,Bullock County,H1
7
+ AL,01,013,Butler County,H1
8
+ AL,01,015,Calhoun County,H1
9
+ AL,01,017,Chambers County,H1
10
+ AL,01,019,Cherokee County,H1
11
+ AL,01,021,Chilton County,H1
12
+ AL,01,023,Choctaw County,H1
13
+ AL,01,025,Clarke County,H1
14
+ AL,01,027,Clay County,H1
15
+ AL,01,029,Cleburne County,H1
16
+ AL,01,031,Coffee County,H1
17
+ AL,01,033,Colbert County,H1
18
+ AL,01,035,Conecuh County,H1
19
+ AL,01,037,Coosa County,H1
20
+ AL,01,039,Covington County,H1
21
+ AL,01,041,Crenshaw County,H1
22
+ AL,01,043,Cullman County,H1
23
+ AL,01,045,Dale County,H1
24
+ AL,01,047,Dallas County,H1
25
+ AL,01,049,DeKalb County,H1
26
+ AL,01,051,Elmore County,H1
27
+ AL,01,053,Escambia County,H1
28
+ AL,01,055,Etowah County,H1
29
+ AL,01,057,Fayette County,H1
30
+ AL,01,059,Franklin County,H1
31
+ AL,01,061,Geneva County,H1
32
+ AL,01,063,Greene County,H1
33
+ AL,01,065,Hale County,H1
34
+ AL,01,067,Henry County,H1
35
+ AL,01,069,Houston County,H1
36
+ AL,01,071,Jackson County,H1
37
+ AL,01,073,Jefferson County,H1
38
+ AL,01,075,Lamar County,H1
39
+ AL,01,077,Lauderdale County,H1
40
+ AL,01,079,Lawrence County,H1
41
+ AL,01,081,Lee County,H1
42
+ AL,01,083,Limestone County,H1
43
+ AL,01,085,Lowndes County,H1
44
+ AL,01,087,Macon County,H1
45
+ AL,01,089,Madison County,H1
46
+ AL,01,091,Marengo County,H1
47
+ AL,01,093,Marion County,H1
48
+ AL,01,095,Marshall County,H1
49
+ AL,01,097,Mobile County,H1
50
+ AL,01,099,Monroe County,H1
51
+ AL,01,101,Montgomery County,H1
52
+ AL,01,103,Morgan County,H1
53
+ AL,01,105,Perry County,H1
54
+ AL,01,107,Pickens County,H1
55
+ AL,01,109,Pike County,H1
56
+ AL,01,111,Randolph County,H1
57
+ AL,01,113,Russell County,H1
58
+ AL,01,115,St. Clair County,H1
59
+ AL,01,117,Shelby County,H1
60
+ AL,01,119,Sumter County,H1
61
+ AL,01,121,Talladega County,H1
62
+ AL,01,123,Tallapoosa County,H1
63
+ AL,01,125,Tuscaloosa County,H1
64
+ AL,01,127,Walker County,H1
65
+ AL,01,129,Washington County,H1
66
+ AL,01,131,Wilcox County,H1
67
+ AL,01,133,Winston County,H1
@@ -0,0 +1,75 @@
1
+ AR,05,001,Arkansas County,H1
2
+ AR,05,003,Ashley County,H1
3
+ AR,05,005,Baxter County,H1
4
+ AR,05,007,Benton County,H1
5
+ AR,05,009,Boone County,H1
6
+ AR,05,011,Bradley County,H1
7
+ AR,05,013,Calhoun County,H1
8
+ AR,05,015,Carroll County,H1
9
+ AR,05,017,Chicot County,H1
10
+ AR,05,019,Clark County,H1
11
+ AR,05,021,Clay County,H1
12
+ AR,05,023,Cleburne County,H1
13
+ AR,05,025,Cleveland County,H1
14
+ AR,05,027,Columbia County,H1
15
+ AR,05,029,Conway County,H1
16
+ AR,05,031,Craighead County,H1
17
+ AR,05,033,Crawford County,H1
18
+ AR,05,035,Crittenden County,H1
19
+ AR,05,037,Cross County,H1
20
+ AR,05,039,Dallas County,H1
21
+ AR,05,041,Desha County,H1
22
+ AR,05,043,Drew County,H1
23
+ AR,05,045,Faulkner County,H1
24
+ AR,05,047,Franklin County,H1
25
+ AR,05,049,Fulton County,H1
26
+ AR,05,051,Garland County,H1
27
+ AR,05,053,Grant County,H1
28
+ AR,05,055,Greene County,H1
29
+ AR,05,057,Hempstead County,H1
30
+ AR,05,059,Hot Spring County,H1
31
+ AR,05,061,Howard County,H1
32
+ AR,05,063,Independence County,H1
33
+ AR,05,065,Izard County,H1
34
+ AR,05,067,Jackson County,H1
35
+ AR,05,069,Jefferson County,H1
36
+ AR,05,071,Johnson County,H1
37
+ AR,05,073,Lafayette County,H1
38
+ AR,05,075,Lawrence County,H1
39
+ AR,05,077,Lee County,H1
40
+ AR,05,079,Lincoln County,H1
41
+ AR,05,081,Little River County,H1
42
+ AR,05,083,Logan County,H1
43
+ AR,05,085,Lonoke County,H1
44
+ AR,05,087,Madison County,H1
45
+ AR,05,089,Marion County,H1
46
+ AR,05,091,Miller County,H1
47
+ AR,05,093,Mississippi County,H1
48
+ AR,05,095,Monroe County,H1
49
+ AR,05,097,Montgomery County,H1
50
+ AR,05,099,Nevada County,H1
51
+ AR,05,101,Newton County,H1
52
+ AR,05,103,Ouachita County,H1
53
+ AR,05,105,Perry County,H1
54
+ AR,05,107,Phillips County,H1
55
+ AR,05,109,Pike County,H1
56
+ AR,05,111,Poinsett County,H1
57
+ AR,05,113,Polk County,H1
58
+ AR,05,115,Pope County,H1
59
+ AR,05,117,Prairie County,H1
60
+ AR,05,119,Pulaski County,H1
61
+ AR,05,121,Randolph County,H1
62
+ AR,05,123,St. Francis County,H1
63
+ AR,05,125,Saline County,H1
64
+ AR,05,127,Scott County,H1
65
+ AR,05,129,Searcy County,H1
66
+ AR,05,131,Sebastian County,H1
67
+ AR,05,133,Sevier County,H1
68
+ AR,05,135,Sharp County,H1
69
+ AR,05,137,Stone County,H1
70
+ AR,05,139,Union County,H1
71
+ AR,05,141,Van Buren County,H1
72
+ AR,05,143,Washington County,H1
73
+ AR,05,145,White County,H1
74
+ AR,05,147,Woodruff County,H1
75
+ AR,05,149,Yell County,H1
@@ -0,0 +1,5 @@
1
+ AS,60,010,Eastern District,H1
2
+ AS,60,020,Manu'a District,H1
3
+ AS,60,030,Rose Island,H4
4
+ AS,60,040,Swains Island,H4
5
+ AS,60,050,Western District,H1
@@ -0,0 +1,15 @@
1
+ AZ,04,001,Apache County,H1
2
+ AZ,04,003,Cochise County,H1
3
+ AZ,04,005,Coconino County,H1
4
+ AZ,04,007,Gila County,H1
5
+ AZ,04,009,Graham County,H1
6
+ AZ,04,011,Greenlee County,H1
7
+ AZ,04,012,La Paz County,H1
8
+ AZ,04,013,Maricopa County,H1
9
+ AZ,04,015,Mohave County,H1
10
+ AZ,04,017,Navajo County,H1
11
+ AZ,04,019,Pima County,H1
12
+ AZ,04,021,Pinal County,H1
13
+ AZ,04,023,Santa Cruz County,H1
14
+ AZ,04,025,Yavapai County,H1
15
+ AZ,04,027,Yuma County,H1