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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d9ff176431407154b994ae3514f592aad2ce93e9
4
- data.tar.gz: d4b35af3922fc9c3d45e496d69513b78073901da
3
+ metadata.gz: 751365e0400b5fe88c8c286b23dd37f0b6f5e350
4
+ data.tar.gz: 07befa9ee5d96a0568dd1ac13aca64ceefe98e52
5
5
  SHA512:
6
- metadata.gz: 769c2676f922b58bafd461edefdba94d608175498f13483e79d72647ef86b33563a77d8f85af04fb0cc3369150fc9adce8357f4007ce24df7c963a0ccde6e586
7
- data.tar.gz: 3a83df316d4ba3d91f47cda9eec40fd9fb34d74e8aa68e08d84b4291a904a17a685baadad772d96ce71b993657c2b316e4750a2e6b8169d3c6bfa0e5f5a7ebed
6
+ metadata.gz: 6ab250684ec45cd527bb9094251f9dac4087d0f2d74bf2c86bf207571fd72629cf31603c8ff0dd7dc82734d9a8da0c8640317ec8cae616d44949ea8d5248848e
7
+ data.tar.gz: e028113f032138321817a10b849ce527eaff53b7c74ea6970269bf1c94f3f0d140ddae44c053f40eab6c1d96a44e4f3ef89f89f891925b2d1565216df69020a2
data/README.md CHANGED
@@ -28,7 +28,7 @@ information daily on our website.
28
28
 
29
29
  ## Usage
30
30
 
31
- Example: print all the restaurant names in New York City.
31
+ Example: print the names of all New York City restaurants.
32
32
 
33
33
  ```ruby
34
34
  require 'eaternet'
@@ -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.new(
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.new(
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, lon = $1, $2
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
- # deleted when the program exits.
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
- # extraction
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 { |entry| entry.extract(File.join(dest_dir, entry.name)) }
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
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Eaternet
2
- VERSION = '1.3.3'
3
+ VERSION = '1.3.4'.freeze
3
4
  end
@@ -64,7 +64,7 @@ class AustinAdapterTest < Minitest::Test
64
64
  begin
65
65
  @@agency.violations
66
66
  rescue => e
67
- assert_match /does not/, e.to_s
67
+ assert_match /doesn't/, e.to_s
68
68
  end
69
69
  end
70
70
 
data/test/test_helper.rb CHANGED
@@ -21,3 +21,4 @@ end
21
21
 
22
22
  SNHD_CASSETTE = 'snhd'
23
23
  SF_CASSETTE = 'sf'
24
+ ENV['RUBYZIP_NO_WARN_INVALID_DATE'] = '1'
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.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: 2015-09-01 00:00:00.000000000 Z
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.4.8
304
+ rubygems_version: 2.5.0
305
305
  signing_key:
306
306
  specification_version: 4
307
307
  summary: Regional adapters for restaurant health scores