eaternet 0.2.0 → 0.2.1

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: ccc62ab3ba30754879ff39a1393090fcdc5fed7b
4
- data.tar.gz: 833f87ebb8cc5b2932f45a0e083d24948773c9f7
3
+ metadata.gz: 3c88ca0ebcdf84f7cadc9dfcbae1351e52dd6164
4
+ data.tar.gz: 49195be432ef46dca5da3ad42b8aef14e0b9c7dc
5
5
  SHA512:
6
- metadata.gz: 5b965baff721e99f26c826b362d7c5948005f1e2985623f08d55946094a6092798e6ce7767ec9c04a6884451d813b7338e2d9d13fe68b02f4f16c990958064ee
7
- data.tar.gz: 9b3a111d686ab730ab354febfc8aaf9cae3d82c62be3fbb5cb71876b25e52e9533a955ce4eb796f8f1695f7a42380dc3348963bd082ebaabcbedce3d8f1daf2a
6
+ metadata.gz: da617218947a50b8943b5a71a1e16fb9e244f8364d5b5f1d4215a5c44cdb5ee03fe15fee9775bf0596759f12af7333d3cf4c3a96ce624262a31a5813aa7be6c5
7
+ data.tar.gz: 0939c551fa59e109b6724e5bbc5752d9e6524860d2394bef7aecf685b58e0b643d2aa6f94254bf438b9b48c33da39397e22a0ec460ae2067c6ddc275e76a11bf
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  [![Build Status](https://travis-ci.org/eaternet/adapters-ruby.svg?branch=master)](https://travis-ci.org/eaternet/adapters-ruby)
2
2
  [![Code Climate](https://codeclimate.com/github/eaternet/adapters-ruby/badges/gpa.svg)](https://codeclimate.com/github/eaternet/adapters-ruby)
3
- [![Gem Version](https://badge.fury.io/rb/eaternet-adapters.svg)](http://badge.fury.io/rb/eaternet-adapters)
3
+ [![Gem Version](https://badge.fury.io/rb/eaternet.svg)](http://badge.fury.io/rb/eaternet)
4
4
 
5
- # Eaternet::Adapters
5
+ # Eaternet Health Score Adapters
6
6
 
7
7
  **We're bringing the world's restaurant health inspections online,**
8
8
  into as many sites and apps as possible.
@@ -19,8 +19,8 @@ adapters to pull and publish the information daily on our website and in feeds t
19
19
 
20
20
  | Area | Agency | Ruby Class | Notes |
21
21
  |-------------------|---------------------------------|------------|-----------|
22
- | Las Vegas | Southern Nevada Health District | [`Snhd`](https://github.com/eaternet/adapters-ruby/blob/master/lib/eaternet/adapters/agencies/snhd.rb) | Completed |
23
- | New York City | City of New York Health Dept. | `Nyc` | [Dataset wiki page](https://github.com/eaternet/adapters/wiki/Agency-Notes:-New-York-City), [Pull Request WIP](https://github.com/eaternet/adapters-ruby/pull/8) |
22
+ | Las Vegas | Southern Nevada Health District | [`Snhd`](https://github.com/eaternet/adapters-ruby/blob/master/lib/eaternet/agencies/snhd.rb) | Completed |
23
+ | New York City | City of New York Health Dept. | [`Nyc`](https://github.com/eaternet/adapters-ruby/blob/master/lib/eaternet/agencies/nyc.rb) | Completed, [Dataset wiki page](https://github.com/eaternet/adapters/wiki/Agency:-New-York-City) |
24
24
  | Porland, OR, USA | Multnomah Couty Environmental Health | `Multco` | [Live on website](https://eaternet.io), Open source WIP |
25
25
 
26
26
 
@@ -29,7 +29,7 @@ adapters to pull and publish the information daily on our website and in feeds t
29
29
  Example: print all the restaurant names in the Southern Nevada Health District
30
30
 
31
31
  ```ruby
32
- require 'eaternet/adapters'
32
+ require 'eaternet'
33
33
 
34
34
  agency = Snhd.new
35
35
  agency.businesses.each { |biz| puts biz.name }
@@ -43,7 +43,7 @@ Each adapter provides [a small set of enumerators](https://github.com/eaternet/a
43
43
  Add this line to your application's Gemfile:
44
44
 
45
45
  ```ruby
46
- gem 'eaternet-adapters'
46
+ gem 'eaternet'
47
47
  ```
48
48
 
49
49
  And then execute:
@@ -52,7 +52,7 @@ And then execute:
52
52
 
53
53
  Or install it yourself as:
54
54
 
55
- $ gem install eaternet-adapters
55
+ $ gem install eaternet
56
56
 
57
57
 
58
58
  ## Roadmap
@@ -3,9 +3,6 @@ require 'eaternet/framework/prototype'
3
3
  require 'eaternet/agencies/snhd_config'
4
4
  require 'eaternet/util'
5
5
 
6
- include Eaternet
7
- include Eaternet::Framework::Prototype
8
-
9
6
  module Eaternet
10
7
  module Agencies
11
8
  # An adapter for the Southern Nevada Health District (Las Vegas).
@@ -35,12 +32,12 @@ module Eaternet
35
32
  # The SNHD Developer information page
36
33
  # @see Eaternet::Framework::Prototype Framework module
37
34
  class Snhd
38
- include Prototype::AbstractAdapter
35
+ include Eaternet::Framework::Prototype::AbstractAdapter
39
36
 
40
37
  # (see Eaternet::Framework::Framework::AbstractAdapter#businesses)
41
38
  def businesses
42
39
  lazy_csv_map('restaurant_establishments.csv') do |row|
43
- BusinessData.new(
40
+ Eaternet::Framework::Prototype::BusinessData.new(
44
41
  orig_key: row['permit_number'],
45
42
  name: row['restaurant_name'],
46
43
  address: row['address'],
@@ -53,7 +50,7 @@ module Eaternet
53
50
  # (see Eaternet::Framework::Framework::AbstractAdapter#inspections)
54
51
  def inspections
55
52
  lazy_csv_map('restaurant_inspections.csv') do |row|
56
- InspectionData.new(
53
+ Eaternet::Framework::Prototype::InspectionData.new(
57
54
  orig_key: row['serial_number'],
58
55
  business_orig_key: row['permit_number'],
59
56
  score: row['inspection_grade'],
@@ -65,7 +62,7 @@ module Eaternet
65
62
  # (see Eaternet::Framework::Framework::AbstractAdapter#violations)
66
63
  def violations
67
64
  lazy_csv_map('restaurant_inspection_violations.csv') do |row|
68
- ViolationData.new(
65
+ Eaternet::Framework::Prototype::ViolationData.new(
69
66
  orig_key: row['inspection_violation_id'],
70
67
  inspection_id: row['inspection_id'],
71
68
  violation_kind_id: row['inspection_violation']
@@ -77,7 +74,7 @@ module Eaternet
77
74
  # @todo Add to AbstractAdapter
78
75
  def violation_kinds
79
76
  lazy_csv_map('restaurant_violations.csv') do |row|
80
- ViolationKindData.new(
77
+ Eaternet::Framework::Prototype::ViolationKindData.new(
81
78
  orig_key: row['violation_id'],
82
79
  code: row['violation_code'],
83
80
  demerits: row['violation_demerits'],
@@ -1,3 +1,3 @@
1
1
  module Eaternet
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -0,0 +1,10 @@
1
+ # require 'test_helper'
2
+ # require 'eaternet'
3
+ #
4
+ # class EaternetTest < Minitest::Test
5
+ # def test_get_all_the_names_in_the_snhd
6
+ # agency = Snhd.new
7
+ # names = agency.businesses.each { |biz| puts biz.name }
8
+ #
9
+ # end
10
+ # end
@@ -16,7 +16,7 @@ class SnhdAdapterTest < Minitest::Test
16
16
 
17
17
  def test_businesses_returns_business_data_objects
18
18
  VCR.use_cassette(SNHD_CASSETTE) do
19
- assert_kind_of BusinessData, @@snhd.businesses.first
19
+ assert_kind_of Eaternet::Framework::Prototype::BusinessData, @@snhd.businesses.first
20
20
  end
21
21
  end
22
22
 
@@ -39,7 +39,7 @@ class SnhdAdapterTest < Minitest::Test
39
39
 
40
40
  def test_inspections_returns_inspection_data_objects
41
41
  VCR.use_cassette(SNHD_CASSETTE) do
42
- assert_kind_of InspectionData, @@snhd.inspections.first
42
+ assert_kind_of Eaternet::Framework::Prototype::InspectionData, @@snhd.inspections.first
43
43
  end
44
44
  end
45
45
 
@@ -61,7 +61,7 @@ class SnhdAdapterTest < Minitest::Test
61
61
 
62
62
  def test_violations_returns_violation_data_objects
63
63
  VCR.use_cassette(SNHD_CASSETTE) do
64
- assert_kind_of ViolationData, @@snhd.violations.first
64
+ assert_kind_of Eaternet::Framework::Prototype::ViolationData, @@snhd.violations.first
65
65
  end
66
66
  end
67
67
 
@@ -82,7 +82,7 @@ class SnhdAdapterTest < Minitest::Test
82
82
 
83
83
  def test_violation_kinds_returns_violation_kind_data_objects
84
84
  VCR.use_cassette(SNHD_CASSETTE) do
85
- assert_kind_of ViolationKindData, @@snhd.violation_kinds.first
85
+ assert_kind_of Eaternet::Framework::Prototype::ViolationKindData, @@snhd.violation_kinds.first
86
86
  end
87
87
  end
88
88
 
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robb Shecter
@@ -160,6 +160,7 @@ files:
160
160
  - lib/eaternet/util.rb
161
161
  - lib/eaternet/version.rb
162
162
  - lib/ext/lazy.rb
163
+ - test/eaternet_test.rb
163
164
  - test/fixtures/morris-park-bake-shop.csv
164
165
  - test/lives_1_0/business_test.rb
165
166
  - test/lives_1_0/feed_info_test.rb
@@ -193,6 +194,7 @@ signing_key:
193
194
  specification_version: 4
194
195
  summary: Regional adapters for restaurant health scores
195
196
  test_files:
197
+ - test/eaternet_test.rb
196
198
  - test/fixtures/morris-park-bake-shop.csv
197
199
  - test/lives_1_0/business_test.rb
198
200
  - test/lives_1_0/feed_info_test.rb