eaternet 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af617767abcfabf9ef5d9db64481d40ff6a4c174
4
- data.tar.gz: 157ecfe72159f0bf69fce1482d584d06eec42223
3
+ metadata.gz: 69d5ee1ad12b2a3330be98c3536fc6ff2dfcb6cb
4
+ data.tar.gz: e5303a438a035a75f920f9bb9dccbbb7cfe33cbf
5
5
  SHA512:
6
- metadata.gz: 209c90a1a9bd7e0524dc114624dcaf5ef90af0e26d98582797b80b83702d2fc34cd10b567a7a210dc8b147175566188b6468d52cdd0901d68036db88aed4c772
7
- data.tar.gz: cf63bcaf4d071b8f13b9135b26aa2d92eb2cbf93118a340666f9749af5a36b39c9495b6915c0612dc1a72ea12305bf1bcd7642a49e56d630727547f0ca8ec187
6
+ metadata.gz: 8c603eaa53c4ac06e76d1b9804291e252ace7af9dd956bc19aaca529bba08fcc30dc456149596d282dcadcc43a5908c875609c80d0facefc1469fea6aab284f3
7
+ data.tar.gz: e125485f3ee7cc6e05b55e2a7b14b0df06a8257746161665aae8b3bc6c14989612460e422cf58eb2dbc86262052be48384ff6d7d847d87530c50b3addcfc4cc7
@@ -99,8 +99,8 @@ module Eaternet
99
99
  def try_to_create_business(row)
100
100
  business(row)
101
101
  rescue ArgumentError => e
102
- logger.warn('Eaternet') do
103
- "Could not create a NYC Business from #{row.inspect}: #{e}"
102
+ logger.warn('NYC LIVES adapter') do
103
+ "Could not create a LIVES Business from #{row.inspect}: #{e}"
104
104
  end
105
105
  nil
106
106
  end
@@ -108,8 +108,8 @@ module Eaternet
108
108
  def try_to_create_inspection(row)
109
109
  inspection(row)
110
110
  rescue ArgumentError => e
111
- logger.warn('Eaternet') do
112
- "Could not create a NYC Inspection from #{row.inspect}: #{e}"
111
+ logger.warn('NYC LIVES adapter') do
112
+ "Could not create a LIVES Inspection from #{row.inspect}: #{e}"
113
113
  end
114
114
  nil
115
115
  end
@@ -121,6 +121,8 @@ module Eaternet
121
121
  b.address = "#{row['BUILDING']} #{row['STREET']}"
122
122
  b.city = row['BORO']
123
123
  b.postal_code = row['ZIPCODE']
124
+ b.state = 'NY'
125
+ b.phone_number = row['PHONE']
124
126
  end
125
127
  end
126
128
 
@@ -129,6 +131,7 @@ module Eaternet
129
131
  v.business_id = business_id(row)
130
132
  v.date = Date.strptime(row['INSPECTION DATE'], '%m/%d/%Y')
131
133
  v.code = violation_kind_id(row)
134
+ v.description = row['VIOLATION DESCRIPTION']
132
135
  end
133
136
  end
134
137
 
@@ -4,12 +4,12 @@ module Eaternet
4
4
  module Lives_1_0
5
5
  # Legends are mappings from score ranges to human-readable descriptions of
6
6
  # those scores. Municipalities can use these to communicate the way scores
7
- # are traditionally presented. For example, 0-60 may map to ‘Fail’ or 95-100
8
- # may map to ‘A+’. The provided ranges in {#minimum_score} and
7
+ # are traditionally presented. For example, 0-60 may map to ‘Fail’ or
8
+ # 95-100 may map to ‘A+’. The provided ranges in {#minimum_score} and
9
9
  # {#maximum_score} must cover the entire 0-100 span without overlap. For
10
10
  # scores at the edge of two ranges, the greater range will be used. For
11
- # example, if 80-90 is a ‘B’ and 90-100 is an ‘A’, a score of 90 would be an
12
- # ‘A’. These are optional.
11
+ # example, if 80-90 is a ‘B’ and 90-100 is an ‘A’, a score of 90 would be
12
+ # an ‘A’. These are optional.
13
13
  #
14
14
  # @see LegendGroup Lives_1_0::LegendGroup, which enforces the 0–100 span and
15
15
  # checks for overlap.
@@ -32,7 +32,7 @@ module Eaternet
32
32
  # @example Making an instance invalid
33
33
  # dog1.birthday = '2015-01-23'
34
34
  # dog1.valid? # => false
35
- # dog1.check_validations! # => ArgumentError: birthday is not of class Date
35
+ # dog1.check_validations! # => ArgumentError: Birthday is class String, not Date
36
36
  #
37
37
  # @see Eaternet::ValidatedObject::TypeValidator
38
38
  # @see http://yehudakatz.com/2010/01/10/activemodel-make-any-ruby-object-feel-like-activerecord/ ActiveModel: Make Any Ruby Object Feel Like ActiveRecord, Yehuda Katz
@@ -1,3 +1,3 @@
1
1
  module Eaternet
2
- VERSION = '0.3.6'
2
+ VERSION = '0.3.7'
3
3
  end
@@ -24,6 +24,8 @@ class NycAdapterTest < Minitest::Test
24
24
  assert_equal '1007 MORRIS PARK AVE', b.address
25
25
  assert_equal 'BRONX', b.city
26
26
  assert_equal '10462', b.postal_code
27
+ assert_equal 'NY', b.state
28
+ assert_equal '7188924968', b.phone_number
27
29
  end
28
30
 
29
31
  def test_businesses_returns_unique_rows
@@ -73,6 +75,7 @@ class NycAdapterTest < Minitest::Test
73
75
  assert_equal '30075445', v.business_id
74
76
  assert_equal Date.new(2015, 2, 9), v.date
75
77
  assert_equal '06C', v.code
78
+ assert_match /Food not protected/, v.description
76
79
  end
77
80
 
78
81
  def test_finds_correct_violations
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: 0.3.6
4
+ version: 0.3.7
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-05-25 00:00:00.000000000 Z
11
+ date: 2015-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler