zip-codes 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7474243c9697846d7913fa24b60800b80b499198
4
+ data.tar.gz: 516406fe15befaefccc9251adc2b90ae9f7864a4
5
+ SHA512:
6
+ metadata.gz: bc2e50b622e222b547e30cbdd985030cdbd109dedd2016cb64cd846822300f3536c8fffad1d9b6872b20cfa902a2a1339b7b8b0fad8f4cdb795a9bf7ec0f8f88
7
+ data.tar.gz: 850760aa7975d024b8fc827ff07e7ce205625402ba189c08324446908dc4665b656c8bc8e7f71490a87a57b82fe18072277c45db511a24c1e19068d13dfc3cd9
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ /lib/data/*.txt
2
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in zip-codes.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,17 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ zip-codes (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.1.0)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 1.3)
16
+ rake
17
+ zip-codes!
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Monterail.com
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ require "bundler/gem_tasks"
2
+ require 'yaml'
3
+
4
+ task :convert do
5
+ codes = {}
6
+ File.open('lib/data/US.txt').each_line do |line|
7
+ array = line.split("\t")
8
+ codes[array[1]] = {
9
+ state_code: array[4],
10
+ state_name: array[3],
11
+ city: array[2]
12
+ }
13
+ end
14
+
15
+ File.open("lib/data/US.yml", "w") do |file|
16
+ file.write codes.to_yaml
17
+ end
18
+ end