eaternet 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eaternet/agencies/nyc.rb +4 -9
- data/lib/eaternet/util.rb +13 -0
- data/lib/eaternet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aef5964ed9df66f15b67479666a138c217dc4e2e
|
4
|
+
data.tar.gz: 7b5576bb97873aaa7a945fefb8fad5b73f950878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41657aba33ed69e9f91cde7cdf46e6f8a75a777fdfd94beaa56bf1241c414a8a83143619a21140dc45502413a5895dec4a2663e9d660d643aa56b0e975673527
|
7
|
+
data.tar.gz: 35357963b80e1dfe1a01010e6a952dff5ff0cc2ffe06432b499c6217b020d747a639d0c35e9daa064eaaa734929d1775bf829f95c8bc9e75676fd6bc77f48f36
|
@@ -115,13 +115,13 @@ module Eaternet
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def business(row)
|
118
|
-
address = "#{
|
118
|
+
address = "#{row['BUILDING']} #{row['STREET']}"
|
119
119
|
|
120
120
|
Business.new do |b|
|
121
121
|
b.business_id = business_id(row)
|
122
|
-
b.name =
|
123
|
-
b.address = address
|
124
|
-
b.city =
|
122
|
+
b.name = Eaternet::Util.cleanup_title(row['DBA'])
|
123
|
+
b.address = Eaternet::Util.cleanup_title(address)
|
124
|
+
b.city = Eaternet::Util.cleanup_title(row['BORO'])
|
125
125
|
b.postal_code = row['ZIPCODE']
|
126
126
|
b.state = 'NY'
|
127
127
|
b.phone_number = row['PHONE']
|
@@ -207,11 +207,6 @@ module Eaternet
|
|
207
207
|
def self.download_via_url(a_file)
|
208
208
|
a_file.write(open(CSV_URL).read)
|
209
209
|
end
|
210
|
-
|
211
|
-
def cleanup(a_string)
|
212
|
-
return nil if a_string.nil?
|
213
|
-
a_string.strip.gsub(/ +/, ' ')
|
214
|
-
end
|
215
210
|
end
|
216
211
|
end
|
217
212
|
end
|
data/lib/eaternet/util.rb
CHANGED
@@ -43,5 +43,18 @@ module Eaternet
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
# Remove extraneous whitespace and ensure capitalization
|
48
|
+
# is correct for a proper name or title.
|
49
|
+
def self.cleanup_title(a_string)
|
50
|
+
return nil if a_string.nil?
|
51
|
+
cleanup(a_string).titleize
|
52
|
+
end
|
53
|
+
|
54
|
+
# Remove extraneous whitespace from the string
|
55
|
+
def self.cleanup(a_string)
|
56
|
+
return nil if a_string.nil?
|
57
|
+
a_string.strip.gsub(/ +/, ' ')
|
58
|
+
end
|
46
59
|
end
|
47
60
|
end
|
data/lib/eaternet/version.rb
CHANGED