census_data 0.1.0 → 0.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.
- data/census_data-0.1.0.gem +0 -0
- data/census_data.gemspec +1 -4
- data/examples/pull_data_by_zipcode.rb +1 -1
- data/lib/census_data.rb +3 -3
- metadata +3 -18
Binary file
|
data/census_data.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
PROJECT_GEM = 'census_data'
|
3
|
-
PROJECT_GEM_VERSION = '0.1.
|
3
|
+
PROJECT_GEM_VERSION = '0.1.1'
|
4
4
|
|
5
5
|
s.name = PROJECT_GEM
|
6
6
|
s.version = PROJECT_GEM_VERSION
|
@@ -15,9 +15,6 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.summary = 'Ruby gem/plugin to pull census data based on zip code and dislpay the median income for that area.'
|
16
16
|
s.description = 'Ruby gem/plugin to pull census data based on zip code and dislpay the median income for that area. Checkout the project on github for more detail.'
|
17
17
|
|
18
|
-
s.add_dependency('typhoeus', '0.1.0')
|
19
|
-
|
20
|
-
|
21
18
|
s.files = `git ls-files`.split("\n")
|
22
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
23
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
data/lib/census_data.rb
CHANGED
@@ -5,7 +5,7 @@ class CensusData
|
|
5
5
|
county_code = ''
|
6
6
|
median_income = ''
|
7
7
|
|
8
|
-
path = File.dirname(__FILE__) + '
|
8
|
+
path = File.expand_path(File.dirname(__FILE__)) + '/../data/county_names_by_zip.txt'
|
9
9
|
CSV.foreach(path, {:headers => true}) do |row|
|
10
10
|
if row[0] == zip_code.to_s
|
11
11
|
county_name = row[12].capitalize
|
@@ -13,7 +13,7 @@ class CensusData
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
path = File.dirname(__FILE__) + '
|
16
|
+
path = File.expand_path(File.dirname(__FILE__)) + '/../data/FipsCountyCodes.csv'
|
17
17
|
CSV.foreach(path, {:headers => true}) do |row|
|
18
18
|
county_to_match = row[1].split(", ")[1]
|
19
19
|
if county_name == county_to_match
|
@@ -22,7 +22,7 @@ class CensusData
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
path = File.dirname(__FILE__) + '
|
25
|
+
path = File.expand_path(File.dirname(__FILE__)) + '/../data/IncomeDataSet.txt'
|
26
26
|
CSV.foreach(path, {:headers => true}) do |row|
|
27
27
|
if row[0] == county_code
|
28
28
|
median_income = row[32]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: census_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,23 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2013-02-13 00:00:00.000000000 Z
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: typhoeus
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - '='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.1.0
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - '='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.1.0
|
13
|
+
dependencies: []
|
30
14
|
description: Ruby gem/plugin to pull census data based on zip code and dislpay the
|
31
15
|
median income for that area. Checkout the project on github for more detail.
|
32
16
|
email: mark@gbdev.com
|
@@ -37,6 +21,7 @@ files:
|
|
37
21
|
- Gemfile
|
38
22
|
- Gemfile.lock
|
39
23
|
- Rakefile
|
24
|
+
- census_data-0.1.0.gem
|
40
25
|
- census_data.gemspec
|
41
26
|
- data/.DS_Store
|
42
27
|
- data/DataDict.txt
|