eaternet 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/eaternet/agencies/austin.rb +10 -8
- data/lib/eaternet/util.rb +7 -4
- data/lib/eaternet/version.rb +2 -1
- data/test/eaternet/agencies/austin_test.rb +1 -1
- data/test/test_helper.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 751365e0400b5fe88c8c286b23dd37f0b6f5e350
|
4
|
+
data.tar.gz: 07befa9ee5d96a0568dd1ac13aca64ceefe98e52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ab250684ec45cd527bb9094251f9dac4087d0f2d74bf2c86bf207571fd72629cf31603c8ff0dd7dc82734d9a8da0c8640317ec8cae616d44949ea8d5248848e
|
7
|
+
data.tar.gz: e028113f032138321817a10b849ce527eaff53b7c74ea6970269bf1c94f3f0d140ddae44c053f40eab6c1d96a44e4f3ef89f89f891925b2d1565216df69020a2
|
data/README.md
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'eaternet/socrata'
|
2
3
|
|
3
4
|
module Eaternet
|
@@ -34,15 +35,11 @@ module Eaternet
|
|
34
35
|
end
|
35
36
|
|
36
37
|
def violations
|
37
|
-
raise Eaternet::UnsupportedError
|
38
|
-
'The city of Austin does not publish violation data'
|
39
|
-
)
|
38
|
+
raise Eaternet::UnsupportedError, "Austin doesn't publish violation data"
|
40
39
|
end
|
41
40
|
|
42
41
|
def legends
|
43
|
-
raise Eaternet::UnsupportedError
|
44
|
-
'The city of Austin does not assign letter grades'
|
45
|
-
)
|
42
|
+
raise Eaternet::UnsupportedError, 'Austin does not assign letter grades'
|
46
43
|
end
|
47
44
|
|
48
45
|
def feed_info
|
@@ -70,10 +67,16 @@ module Eaternet
|
|
70
67
|
|
71
68
|
# Address is a multi-line, multi-value cell
|
72
69
|
address_lines = row['Address'].split("\n")
|
70
|
+
if address_lines.size != 3
|
71
|
+
fail ArgumentError,
|
72
|
+
"Address doesn't have three lines: {row['Address']}"
|
73
|
+
end
|
74
|
+
|
73
75
|
address = address_lines.first
|
74
76
|
city = address_lines[1].split(',').first
|
75
77
|
address_lines[2] =~ /^\(([^,]+), (.+)\)$/
|
76
|
-
lat
|
78
|
+
lat = Regexp.last_match(1)
|
79
|
+
lon = Regexp.last_match(2)
|
77
80
|
|
78
81
|
b.business_id = row['Facility ID']
|
79
82
|
b.name = row['Restaurant Name']
|
@@ -103,7 +106,6 @@ module Eaternet
|
|
103
106
|
def adapter_name
|
104
107
|
'Austin'
|
105
108
|
end
|
106
|
-
|
107
109
|
end
|
108
110
|
end
|
109
111
|
end
|
data/lib/eaternet/util.rb
CHANGED
@@ -16,8 +16,8 @@ module Eaternet
|
|
16
16
|
dir
|
17
17
|
end
|
18
18
|
|
19
|
-
# Create a temporary directory which is automatically
|
20
|
-
#
|
19
|
+
# Create a temporary directory which is automatically deleted when the
|
20
|
+
# program exits.
|
21
21
|
#
|
22
22
|
# @return [String] the directory path
|
23
23
|
def self.make_temp_dir
|
@@ -53,12 +53,15 @@ module Eaternet
|
|
53
53
|
#
|
54
54
|
# @param [String] path the Zip file's location
|
55
55
|
# @param [String] dest_dir directory in which to perform the
|
56
|
-
#
|
56
|
+
# extraction
|
57
57
|
# @return nil
|
58
58
|
def self.extract_zipfile(path:, dest_dir:)
|
59
59
|
open(path) do |zip_file|
|
60
60
|
Zip::File.open(zip_file, 'rb') do |zip_data|
|
61
|
-
zip_data.each
|
61
|
+
zip_data.each do |entry|
|
62
|
+
dest_path = File.join(dest_dir, entry.name)
|
63
|
+
entry.extract(dest_path)
|
64
|
+
end
|
62
65
|
end
|
63
66
|
end
|
64
67
|
end
|
data/lib/eaternet/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eaternet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robb Shecter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -301,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
301
|
version: '0'
|
302
302
|
requirements: []
|
303
303
|
rubyforge_project:
|
304
|
-
rubygems_version: 2.
|
304
|
+
rubygems_version: 2.5.0
|
305
305
|
signing_key:
|
306
306
|
specification_version: 4
|
307
307
|
summary: Regional adapters for restaurant health scores
|