usa_states 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +100 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/usa_states/version.rb +3 -0
- data/lib/usa_states.rb +66 -0
- data/usa_states.gemspec +26 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1cf361cf51f600ca3524bf856aa56c38647cb343
|
4
|
+
data.tar.gz: a515815ce7f02c4263dc9627e92003868e9aed55
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ebf38b5ff7c4441b9d17cb416527a6ad6c2527a5921da99b501df939543a73724228b75dea5e6bf933c558998f4398db96e1e8f181bc14c83dfd995962d2861f
|
7
|
+
data.tar.gz: 3d2873c90dc75dfd7e0991169e3626857cd232caeacf301cfe861073753c5d91ae31186134857d680472ec333944282e3010a974244c0320475b243f86e6be9c
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Matic Insurance
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
# UsaStates
|
2
|
+
|
3
|
+
UsaStates is tiny gem that provides full list of USA states
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'usa_states'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install usa_states
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
You can get list of state codes strings with:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
UsaStates.codes
|
27
|
+
```
|
28
|
+
|
29
|
+
## List
|
30
|
+
|
31
|
+
List of states was taken from [this gist](https://gist.github.com/rdetert/f89cd2b2d52ee423abca).
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
{ AK: 'Alaska',
|
35
|
+
AL: 'Alabama',
|
36
|
+
AR: 'Arkansas',
|
37
|
+
AS: 'American Samoa',
|
38
|
+
AZ: 'Arizona',
|
39
|
+
CA: 'California',
|
40
|
+
CO: 'Colorado',
|
41
|
+
CT: 'Connecticut',
|
42
|
+
DC: 'District of Columbia',
|
43
|
+
DE: 'Delaware',
|
44
|
+
FL: 'Florida',
|
45
|
+
GA: 'Georgia',
|
46
|
+
GU: 'Guam',
|
47
|
+
HI: 'Hawaii',
|
48
|
+
IA: 'Iowa',
|
49
|
+
ID: 'Idaho',
|
50
|
+
IL: 'Illinois',
|
51
|
+
IN: 'Indiana',
|
52
|
+
KS: 'Kansas',
|
53
|
+
KY: 'Kentucky',
|
54
|
+
LA: 'Louisiana',
|
55
|
+
MA: 'Massachusetts',
|
56
|
+
MD: 'Maryland',
|
57
|
+
ME: 'Maine',
|
58
|
+
MI: 'Michigan',
|
59
|
+
MN: 'Minnesota',
|
60
|
+
MO: 'Missouri',
|
61
|
+
MS: 'Mississippi',
|
62
|
+
MT: 'Montana',
|
63
|
+
NC: 'North Carolina',
|
64
|
+
ND: 'North Dakota',
|
65
|
+
NE: 'Nebraska',
|
66
|
+
NH: 'New Hampshire',
|
67
|
+
NJ: 'New Jersey',
|
68
|
+
NM: 'New Mexico',
|
69
|
+
NV: 'Nevada',
|
70
|
+
NY: 'New York',
|
71
|
+
OH: 'Ohio',
|
72
|
+
OK: 'Oklahoma',
|
73
|
+
OR: 'Oregon',
|
74
|
+
PA: 'Pennsylvania',
|
75
|
+
PR: 'Puerto Rico',
|
76
|
+
RI: 'Rhode Island',
|
77
|
+
SC: 'South Carolina',
|
78
|
+
SD: 'South Dakota',
|
79
|
+
TN: 'Tennessee',
|
80
|
+
TX: 'Texas',
|
81
|
+
UT: 'Utah',
|
82
|
+
VA: 'Virginia',
|
83
|
+
VI: 'Virgin Islands',
|
84
|
+
VT: 'Vermont',
|
85
|
+
WA: 'Washington',
|
86
|
+
WI: 'Wisconsin',
|
87
|
+
WV: 'West Virginia',
|
88
|
+
WY: 'Wyoming'
|
89
|
+
}
|
90
|
+
```
|
91
|
+
|
92
|
+
## Development
|
93
|
+
|
94
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
95
|
+
|
96
|
+
To install this gem onto your local machine, run `bundle exec rake install`. 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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
97
|
+
|
98
|
+
## Contributing
|
99
|
+
|
100
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/matic-insurance/usa_states.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "usa_states"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/usa_states.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'usa_states/version'
|
2
|
+
|
3
|
+
class UsaStates
|
4
|
+
HASH = { AK: 'Alaska',
|
5
|
+
AL: 'Alabama',
|
6
|
+
AR: 'Arkansas',
|
7
|
+
AS: 'American Samoa',
|
8
|
+
AZ: 'Arizona',
|
9
|
+
CA: 'California',
|
10
|
+
CO: 'Colorado',
|
11
|
+
CT: 'Connecticut',
|
12
|
+
DC: 'District of Columbia',
|
13
|
+
DE: 'Delaware',
|
14
|
+
FL: 'Florida',
|
15
|
+
GA: 'Georgia',
|
16
|
+
GU: 'Guam',
|
17
|
+
HI: 'Hawaii',
|
18
|
+
IA: 'Iowa',
|
19
|
+
ID: 'Idaho',
|
20
|
+
IL: 'Illinois',
|
21
|
+
IN: 'Indiana',
|
22
|
+
KS: 'Kansas',
|
23
|
+
KY: 'Kentucky',
|
24
|
+
LA: 'Louisiana',
|
25
|
+
MA: 'Massachusetts',
|
26
|
+
MD: 'Maryland',
|
27
|
+
ME: 'Maine',
|
28
|
+
MI: 'Michigan',
|
29
|
+
MN: 'Minnesota',
|
30
|
+
MO: 'Missouri',
|
31
|
+
MS: 'Mississippi',
|
32
|
+
MT: 'Montana',
|
33
|
+
NC: 'North Carolina',
|
34
|
+
ND: 'North Dakota',
|
35
|
+
NE: 'Nebraska',
|
36
|
+
NH: 'New Hampshire',
|
37
|
+
NJ: 'New Jersey',
|
38
|
+
NM: 'New Mexico',
|
39
|
+
NV: 'Nevada',
|
40
|
+
NY: 'New York',
|
41
|
+
OH: 'Ohio',
|
42
|
+
OK: 'Oklahoma',
|
43
|
+
OR: 'Oregon',
|
44
|
+
PA: 'Pennsylvania',
|
45
|
+
PR: 'Puerto Rico',
|
46
|
+
RI: 'Rhode Island',
|
47
|
+
SC: 'South Carolina',
|
48
|
+
SD: 'South Dakota',
|
49
|
+
TN: 'Tennessee',
|
50
|
+
TX: 'Texas',
|
51
|
+
UT: 'Utah',
|
52
|
+
VA: 'Virginia',
|
53
|
+
VI: 'Virgin Islands',
|
54
|
+
VT: 'Vermont',
|
55
|
+
WA: 'Washington',
|
56
|
+
WI: 'Wisconsin',
|
57
|
+
WV: 'West Virginia',
|
58
|
+
WY: 'Wyoming'
|
59
|
+
}.freeze
|
60
|
+
|
61
|
+
private_constant(:HASH)
|
62
|
+
|
63
|
+
def self.codes
|
64
|
+
HASH.keys.map(&:to_s)
|
65
|
+
end
|
66
|
+
end
|
data/usa_states.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'usa_states/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'usa_states'
|
8
|
+
spec.version = UsaStates::VERSION
|
9
|
+
spec.authors = ['Sergey Kukunin']
|
10
|
+
spec.email = ['sergey.kukunin@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'Simple Hash with all USA States'
|
13
|
+
spec.description = 'Simple Hash, that provides full list of USA states'
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
16
|
+
f.match(%r{^(test|spec|features)/})
|
17
|
+
end
|
18
|
+
|
19
|
+
spec.bindir = 'exe'
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.11'
|
24
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: usa_states
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sergey Kukunin
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Simple Hash, that provides full list of USA states
|
56
|
+
email:
|
57
|
+
- sergey.kukunin@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- Gemfile
|
66
|
+
- LICENSE
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- bin/console
|
70
|
+
- bin/setup
|
71
|
+
- lib/usa_states.rb
|
72
|
+
- lib/usa_states/version.rb
|
73
|
+
- usa_states.gemspec
|
74
|
+
homepage:
|
75
|
+
licenses: []
|
76
|
+
metadata: {}
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.5.1
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: Simple Hash with all USA States
|
97
|
+
test_files: []
|