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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46b957b72f5d34668b2de39feea374370d630590
4
- data.tar.gz: 2b7facc64936af8718f374fa9423246775211f47
3
+ metadata.gz: aef5964ed9df66f15b67479666a138c217dc4e2e
4
+ data.tar.gz: 7b5576bb97873aaa7a945fefb8fad5b73f950878
5
5
  SHA512:
6
- metadata.gz: 0c21c49824a2e6be256d734a9f843f23abf1128a11c66b82558354e8c8f9b3febbad97f07e35ad7789a48150b9846c8e22e9f9c82d62844241da268c200047e8
7
- data.tar.gz: ac79c70d1ef9d5b5eaf4e76990ba4534c7161e291060a1fff09facce7613443a68133483293cf235301b3e93eeb165dad18fe1e8969dc05431fa7561b521f4e1
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 = "#{cleanup(row['BUILDING'])} #{cleanup(row['STREET'])}"
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 = row['DBA'].titleize
123
- b.address = address.titleize
124
- b.city = row['BORO'].titleize
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
@@ -1,3 +1,3 @@
1
1
  module Eaternet
2
- VERSION = '0.3.9'
2
+ VERSION = '0.3.10'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eaternet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robb Shecter