eaternet 1.3.8 → 1.3.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5d1cb4d7f2f6d148c9ca9d77df3a54f27649fab
|
4
|
+
data.tar.gz: 0924a78eebff1ac3c671606b04039f2745f00210
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8335d54ab71a2b26f51ce163ecbafab2cf5d9bfe36d9f337cb5fdb6d1c9ab914c02d016b083f898cb8970e6c64d90c0ce42d1d7802522af369dbdbc0ea028157
|
7
|
+
data.tar.gz: 74118d3daa2331ba2c5e9da671368e8f24c2718d32c7fcb2a43665fe889ce287aba8830e0d75e608750789a940bcfa21f8c80814ecd3cf4517fcb0fbbd00ed91
|
@@ -49,13 +49,19 @@ module Eaternet
|
|
49
49
|
|
50
50
|
# (see Eaternet::Prototype::AbstractAdapter#violations)
|
51
51
|
def violations
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
result = []
|
53
|
+
|
54
|
+
inspections.each do |i|
|
55
|
+
i.violations.each do |v|
|
56
|
+
result << Eaternet::Prototype::ViolationData.new(
|
57
|
+
inspection_id: i.orig_key,
|
58
|
+
violation_kind_id: v,
|
59
|
+
orig_key: 'n/a'
|
60
|
+
)
|
61
|
+
end
|
58
62
|
end
|
63
|
+
|
64
|
+
result
|
59
65
|
end
|
60
66
|
|
61
67
|
# @return [Enumerable<ViolationKindData>]
|
data/lib/eaternet/util.rb
CHANGED
@@ -32,11 +32,11 @@ module Eaternet
|
|
32
32
|
# @param [String] dest pathname in which to save the file
|
33
33
|
# @return [File] the file
|
34
34
|
def self.download_and_cache(source:, dest:)
|
35
|
-
download(source: source, dest: dest)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
# download(source: source, dest: dest)
|
36
|
+
cache_path = generate_cache_path(source)
|
37
|
+
download(source: source, dest: cache_path) if expired? cache_path
|
38
|
+
FileUtils.cp cache_path, dest
|
39
|
+
File.open dest
|
40
40
|
end
|
41
41
|
|
42
42
|
# Download a file from the network.
|
data/lib/eaternet/version.rb
CHANGED
@@ -88,9 +88,9 @@ class SnhdPrototypeAdapterTest < Minitest::Test
|
|
88
88
|
def test_violations_returns_correct_data
|
89
89
|
VCR.use_cassette(SNHD_CASSETTE) do
|
90
90
|
v = @@snhd_prototype.violations.first
|
91
|
-
assert_equal '
|
92
|
-
assert_equal '
|
93
|
-
assert_equal '
|
91
|
+
assert_equal 'n/a', v.orig_key
|
92
|
+
assert_equal 'DA0001096', v.inspection_id
|
93
|
+
assert_equal '8', v.violation_kind_id
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|