eaternet 1.0.3 → 1.0.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 +3 -6
- data/lib/eaternet/agencies/multco.rb +12 -0
- data/lib/eaternet/agencies/nyc.rb +4 -0
- data/lib/eaternet/lives_1_0/csv_parser.rb +2 -2
- data/lib/eaternet/version.rb +1 -1
- data/test/eaternet/agencies/nyc_test.rb +5 -1
- data/test/fixtures/{morris-park-bake-shop.csv → nyc.csv} +1 -0
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a05d4cd0cc0d3226970b904914b26df1f449698
|
4
|
+
data.tar.gz: 8671f3df54ad1b83c57b48603a60ab5118a13540
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a585fec3107eaa0e5006664f7426403b2cbb23933ef52607b9613acec8cc82a873058c3b57dcb8c550cf594a92440f4222453c2cad7a2b77e54d1f71b287b3c
|
7
|
+
data.tar.gz: a8ae0719ef5b1028c641478ae72e4554cbb2a8528d1764a25622e42166344f03e1782fe8efbd9b98b3f6735e26b864de6aef4b3893fef283870745979310a81b
|
data/README.md
CHANGED
@@ -2,12 +2,9 @@
|
|
2
2
|
[![Code Climate](https://codeclimate.com/github/eaternet/adapters-ruby/badges/gpa.svg)](https://codeclimate.com/github/eaternet/adapters-ruby)
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/eaternet.svg)](http://badge.fury.io/rb/eaternet)
|
4
4
|
|
5
|
-
#
|
5
|
+
# LIVES-data Health Score Adapters
|
6
6
|
|
7
|
-
|
8
|
-
many sites and apps as possible.
|
9
|
-
|
10
|
-
Use this repo to publish your local restaurant health scores.
|
7
|
+
Publish your local restaurant health scores.
|
11
8
|
|
12
9
|
**In a nutshell:** each agency which inspects restaurants can have an
|
13
10
|
"adapter" which is a Ruby class. Its adapter converts its source format into [a
|
@@ -23,7 +20,7 @@ information daily on our website.
|
|
23
20
|
|-------------------|--------------------------------------|------------|-----------|
|
24
21
|
| Las Vegas | Southern Nevada Health District | [`Snhd`](https://github.com/eaternet/adapters-ruby/blob/master/lib/eaternet/agencies/snhd.rb) | Needs refactoring and docs |
|
25
22
|
| New York City | City of New York Health Deptartment | [`Nyc`](https://github.com/eaternet/adapters-ruby/blob/master/lib/eaternet/agencies/nyc.rb) | [Dataset wiki page](https://github.com/eaternet/adapters/wiki/Agency:-New-York-City) |
|
26
|
-
|
|
23
|
+
| Portland, OR, USA | Multnomah Couty Environmental Health | [`Multco`](https://github.com/eaternet/adapters-ruby/blob/master/lib/eaternet/agencies/multco.rb) | Deprecated. Needs to be updated to use the Accela API |
|
27
24
|
| San Francisco | City of San Francisco | [`Sf`](https://github.com/eaternet/adapters-ruby/blob/master/lib/eaternet/agencies/sf.rb) | Needs docs |
|
28
25
|
|
29
26
|
|
@@ -7,6 +7,18 @@ require 'eaternet/loggable'
|
|
7
7
|
|
8
8
|
module Eaternet
|
9
9
|
module Agencies
|
10
|
+
|
11
|
+
# A Multnomah County (Portland area) Oregon data source for restaurant
|
12
|
+
# health inspections.
|
13
|
+
#
|
14
|
+
# It produces output in the [LIVES 1.0](http://www.yelp.com/healthscores)
|
15
|
+
# open data standard developed by Yelp and the cities of San Francisco and
|
16
|
+
# New York.
|
17
|
+
#
|
18
|
+
# @deprecated In May, the County stopped publishing data from the source app
|
19
|
+
# which this code relies on. Additionally, the County plans to shut down
|
20
|
+
# the legacy app entirely at some point. We're planning a new version of
|
21
|
+
# this code which will use the County's new information portal.
|
10
22
|
class Multco < Eaternet::Lives_1_0::Adapter
|
11
23
|
include Eaternet::Loggable
|
12
24
|
|
@@ -3,11 +3,11 @@ module Eaternet
|
|
3
3
|
module CsvParser
|
4
4
|
|
5
5
|
def adapter_name
|
6
|
-
fail 'Override with a name for log output, e.g. "SF"'
|
6
|
+
fail 'Override #adapter_name with a name for log output, e.g. "SF"'
|
7
7
|
end
|
8
8
|
|
9
9
|
def zip_file_url
|
10
|
-
fail 'Override with the zip archive location'
|
10
|
+
fail 'Override #zip_file_url with the zip archive location'
|
11
11
|
end
|
12
12
|
|
13
13
|
def convert(csv:, to_type:)
|
data/lib/eaternet/version.rb
CHANGED
@@ -4,7 +4,7 @@ require 'eaternet'
|
|
4
4
|
require 'eaternet/lives_1_0'
|
5
5
|
|
6
6
|
CASSETTE = 'nyc'
|
7
|
-
MORRIS_PARK_CSV = 'test/fixtures/
|
7
|
+
MORRIS_PARK_CSV = 'test/fixtures/nyc.csv'
|
8
8
|
|
9
9
|
class NycAdapterTest < Minitest::Test
|
10
10
|
@@nyc = Eaternet::Nyc.new(csv_path: MORRIS_PARK_CSV)
|
@@ -40,6 +40,10 @@ class NycAdapterTest < Minitest::Test
|
|
40
40
|
assert_equal '7188924968', b.phone_number
|
41
41
|
end
|
42
42
|
|
43
|
+
def test_can_create_an_array_from_businesses
|
44
|
+
assert_instance_of Array, @@nyc.businesses.to_a
|
45
|
+
end
|
46
|
+
|
43
47
|
def test_businesses_returns_unique_rows
|
44
48
|
assert_equal 1, @@nyc.businesses.to_a.size
|
45
49
|
end
|
@@ -21,3 +21,4 @@ CAMIS,DBA,BORO,BUILDING,STREET,ZIPCODE,PHONE,CUISINE DESCRIPTION,INSPECTION DATE
|
|
21
21
|
30075445,MORRIS PARK BAKE SHOP,BRONX,1007,MORRIS PARK AVE,10462,7188924968,Bakery,12/31/2012,Violations were cited in the following area(s).,10F,"Non-food contact surface improperly constructed. Unacceptable material used. Non-food contact surface or equipment improperly maintained and/or not properly sealed, raised, spaced or movable to allow accessibility for cleaning on all sides, above and underneath the unit.",Not Critical,25,,,03/06/2015,Cycle Inspection / Initial Inspection
|
22
22
|
30075445,MORRIS PARK BAKE SHOP,BRONX,1007,MORRIS PARK AVE,10462,7188924968,Bakery,12/31/2012,Violations were cited in the following area(s).,16B,"The original nutritional fact labels and/or ingredient label for a cooking oil, shortening or margarine or food item sold in bulk, or acceptable manufacturers documentation not maintained on site.",Not Critical,,,,03/06/2015,Trans Fat / Initial Inspection
|
23
23
|
30075445,MORRIS PARK BAKE SHOP,BRONX,1007,MORRIS PARK AVE,10462,7188924968,Bakery,05/03/2012,No violations were recorded at the time of this inspection.,,,Not Applicable,,,,03/06/2015,Trans Fat / Second Compliance Inspection
|
24
|
+
,Imposter Bake Shop,BRONX,1007,MORRIS PARK AVE,10462,7188924968,Bakery,05/03/2012,No violations were recorded at the time of this inspection.,,,Not Applicable,,,,03/06/2015,Trans Fat / Second Compliance Inspection
|
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.0.
|
4
|
+
version: 1.0.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: 2015-07-
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -274,7 +274,7 @@ files:
|
|
274
274
|
- test/eaternet/loggable_test.rb
|
275
275
|
- test/eaternet/util_test.rb
|
276
276
|
- test/ext/enumerator_test.rb
|
277
|
-
- test/fixtures/
|
277
|
+
- test/fixtures/nyc.csv
|
278
278
|
- test/script.rb
|
279
279
|
- test/test_helper.rb
|
280
280
|
homepage: https://github.com/eaternet/adapters-ruby
|
@@ -315,7 +315,6 @@ test_files:
|
|
315
315
|
- test/eaternet/loggable_test.rb
|
316
316
|
- test/eaternet/util_test.rb
|
317
317
|
- test/ext/enumerator_test.rb
|
318
|
-
- test/fixtures/
|
318
|
+
- test/fixtures/nyc.csv
|
319
319
|
- test/script.rb
|
320
320
|
- test/test_helper.rb
|
321
|
-
has_rdoc:
|