geoblacklight 0.2.1 → 0.2.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 767308fdd3b12467270a409a98f4732062c57878
|
4
|
+
data.tar.gz: b822a8bc6294c81601963a4db3e7fbeef4434b09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1cc828205ad3c72548ad044d20522e306e01461552beea0b02fdd9313717b03fe724fc933ee808d6fe906bbe44c89f0b83967e697679911379d9b2e77d54b13
|
7
|
+
data.tar.gz: 27812b3d5d30157ab0c9e2a0e273d5dd5abe111503325edadae9fbc19a5a4d5706a473ad317e4501d5234969b490c3dad00691694177fc8a4745bd880db5aedb
|
@@ -42,7 +42,9 @@ module Geoblacklight
|
|
42
42
|
def downloads_by_format
|
43
43
|
case format
|
44
44
|
when 'Shapefile'
|
45
|
-
|
45
|
+
if wfs && wms
|
46
|
+
{ shapefile: wfs.to_hash, kmz: wms.to_hash, geojson: wfs.to_hash } if wms.present? && wfs.present?
|
47
|
+
end
|
46
48
|
when 'GeoTIFF'
|
47
49
|
{ geotiff: wms.to_hash } if wms.present?
|
48
50
|
end
|
@@ -12,6 +12,14 @@ describe Geoblacklight::References do
|
|
12
12
|
)
|
13
13
|
)
|
14
14
|
}
|
15
|
+
let(:no_service_shapefile) {
|
16
|
+
Geoblacklight::References.new(
|
17
|
+
SolrDocument.new(
|
18
|
+
dc_format_s: 'Shapefile',
|
19
|
+
dct_references_s: {}.to_json
|
20
|
+
)
|
21
|
+
)
|
22
|
+
}
|
15
23
|
let(:typical_ogp_geotiff) {
|
16
24
|
Geoblacklight::References.new(
|
17
25
|
SolrDocument.new(
|
@@ -95,4 +103,19 @@ describe Geoblacklight::References do
|
|
95
103
|
expect(types.count).to eq 3
|
96
104
|
end
|
97
105
|
end
|
106
|
+
describe 'downloads_by_format' do
|
107
|
+
it 'returns shapefile' do
|
108
|
+
expect(typical_ogp_shapefile.downloads_by_format.count).to eq 3
|
109
|
+
end
|
110
|
+
it 'returns geotiff' do
|
111
|
+
expect(typical_ogp_geotiff.downloads_by_format.count).to eq 1
|
112
|
+
expect(typical_ogp_geotiff.downloads_by_format[:geotiff][:wms]).to eq 'http://hgl.harvard.edu:8080/geoserver/wms'
|
113
|
+
end
|
114
|
+
it 'does not return shapefile if wms and wfs are not present' do
|
115
|
+
expect(no_service_shapefile.downloads_by_format).to be_nil
|
116
|
+
end
|
117
|
+
it 'does not return GeoTIFF if wms is not present' do
|
118
|
+
expect(direct_download_only.downloads_by_format).to be_nil
|
119
|
+
end
|
120
|
+
end
|
98
121
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geoblacklight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Hardy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|