eaternet 0.3.12 → 0.3.13
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 +4 -4
- data/lib/eaternet/agencies/nyc.rb +3 -2
- data/lib/eaternet/util.rb +2 -1
- data/lib/eaternet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fef9d7a3fae0dfa7a51a9dbf736c5da15bfa268
|
4
|
+
data.tar.gz: f62290193115c8e762a8d7dbbbd2fe1f5de869a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5f431d8091b289152792306ccf263aa2e25189e2f464a7af4ee676488f4b084f28f2e1285e5e995638d7c07e8e860e81eb93e3caf5f1a086bcfcb67b81986e3
|
7
|
+
data.tar.gz: 1004ff11639225f50e13965f6e359f6c79db8f0861afaf7486dc3eff06e4c014ead6ae389154dcca9eec1bd4f3fd6ee97ad6788e6ec5370947b940cf18433dc1
|
@@ -13,9 +13,10 @@ require 'eaternet/loggable'
|
|
13
13
|
module Eaternet
|
14
14
|
module Agencies
|
15
15
|
# A data source for New York City food service health inspections. It
|
16
|
-
# retrieves the latest
|
16
|
+
# retrieves the latest CSV export from
|
17
17
|
# [the official source](https://data.cityofnewyork.us/Health/DOHMH-New-York-City-Restaurant-Inspection-Results/xx67-kt59)
|
18
|
-
# and makes it easy to work with.
|
18
|
+
# and makes it easy to work with. The downloaded CSV is cached for twelve
|
19
|
+
# hours in a temporary file by {Eaternet::Util.download_and_cache}
|
19
20
|
#
|
20
21
|
# This library conforms to the
|
21
22
|
# [LIVES 1.0 standard](http://www.yelp.com/healthscores) developed by
|
data/lib/eaternet/util.rb
CHANGED
@@ -10,7 +10,7 @@ module Eaternet
|
|
10
10
|
def self.download_and_extract_zipfile(url)
|
11
11
|
dir = make_temp_dir
|
12
12
|
zip_path = File.join(dir, 'zip-file.zip')
|
13
|
-
|
13
|
+
download_and_cache(source: url, dest: zip_path)
|
14
14
|
extract_zipfile(path: zip_path, dest_dir: dir)
|
15
15
|
dir
|
16
16
|
end
|
@@ -27,6 +27,7 @@ module Eaternet
|
|
27
27
|
#
|
28
28
|
# @param [String] source the URL to retrieve
|
29
29
|
# @param [String] dest pathname in which to save the file
|
30
|
+
# @return [File] the file
|
30
31
|
def self.download_and_cache(source:, dest:)
|
31
32
|
cache_path = generate_cache_path(source)
|
32
33
|
download(source: source, dest: cache_path) if expired? cache_path
|
data/lib/eaternet/version.rb
CHANGED