geoblacklight_sidecar_images 0.9.0 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +15 -7
- data/Gemfile +1 -1
- data/app/services/geoblacklight_sidecar_images/image_service.rb +1 -1
- data/geoblacklight_sidecar_images.gemspec +2 -2
- data/lib/generators/geoblacklight_sidecar_images/config_generator.rb +1 -1
- data/lib/generators/geoblacklight_sidecar_images/jobs_generator.rb +1 -1
- data/lib/generators/geoblacklight_sidecar_images/models_generator.rb +1 -1
- data/lib/geoblacklight_sidecar_images/version.rb +1 -1
- data/lib/tasks/geoblacklight_sidecar_images_tasks.rake +1 -1
- data/spec/fixtures/files/esri-tiled_map_layer.json +7 -7
- data/spec/services/image_service_spec.rb +50 -7
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd8c2ddd29b6cd4330c2e3296304c5af9f03cab9cab7054bed8aab06f85704c9
|
4
|
+
data.tar.gz: a4da3067eaa06960911879b277b79ffca2a75caa48043ba6ca2142978e593e71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06f3bd59d943c81109b6f84c3e67d40b2296e329802afd8358b238eccc6004fe6ba354f32771e4eb2a564025640a710762d2f02be459cae09cfc1c077b9775f1
|
7
|
+
data.tar.gz: afc504bc9dd5fcb597515404a8e3f50ac7f2f85960a9b3c2e62208b7cb2c91482ee83d03173558c20cfb59b752a0039ecdffbb4b851a8154b5982cc6126bf9d7
|
data/.github/workflows/ruby.yml
CHANGED
@@ -10,14 +10,22 @@ on:
|
|
10
10
|
jobs:
|
11
11
|
linter:
|
12
12
|
runs-on: ubuntu-latest
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
bundler_version: [2.2.8]
|
16
|
+
faraday_version: ['~> 2.0']
|
13
17
|
steps:
|
14
18
|
- uses: actions/checkout@v2
|
15
19
|
- name: Set up Ruby
|
16
20
|
uses: ruby/setup-ruby@v1
|
17
21
|
with:
|
18
|
-
ruby-version:
|
22
|
+
ruby-version: 3.3.1
|
23
|
+
- name: Install bundler
|
24
|
+
run: gem install bundler -v ${{ matrix.bundler_version }}
|
19
25
|
- name: Install dependencies
|
20
|
-
run: bundle install
|
26
|
+
run: bundle _${{ matrix.bundler_version }}_ install
|
27
|
+
env:
|
28
|
+
FARADAY_VERSION: ${{ matrix.faraday_version }}
|
21
29
|
- name: Run linter
|
22
30
|
run: bundle exec standardrb
|
23
31
|
|
@@ -25,10 +33,10 @@ jobs:
|
|
25
33
|
runs-on: ubuntu-latest
|
26
34
|
strategy:
|
27
35
|
matrix:
|
28
|
-
ruby_version: [
|
29
|
-
rails_version: [7.0.
|
30
|
-
bundler_version: [2.
|
31
|
-
faraday_version: ['
|
36
|
+
ruby_version: [3.3.1]
|
37
|
+
rails_version: [7.2.0, 7.1.3.2, 7.0.8.1]
|
38
|
+
bundler_version: [2.2.8]
|
39
|
+
faraday_version: ['~> 2.0']
|
32
40
|
|
33
41
|
name: test ruby ${{ matrix.ruby_version }} / rails ${{ matrix.rails_version }} / faraday ${{ matrix.faraday_version }}
|
34
42
|
steps:
|
@@ -66,4 +74,4 @@ jobs:
|
|
66
74
|
if: always()
|
67
75
|
with:
|
68
76
|
name: coverage
|
69
|
-
path: coverage/
|
77
|
+
path: coverage/
|
data/Gemfile
CHANGED
@@ -33,7 +33,7 @@ if File.exist?(file)
|
|
33
33
|
end
|
34
34
|
else
|
35
35
|
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
|
36
|
-
gem "geoblacklight", ">=
|
36
|
+
gem "geoblacklight", ">= 3.8"
|
37
37
|
gem "mini_magick", "~> 4.9.4"
|
38
38
|
gem "image_processing", "~> 1.6"
|
39
39
|
gem "statesman", ">= 3.4"
|
@@ -128,7 +128,7 @@ module GeoblacklightSidecarImages
|
|
128
128
|
return nil unless uri.scheme.include?("http")
|
129
129
|
|
130
130
|
conn = Faraday.new(url: uri.normalize.to_s) do |b|
|
131
|
-
b.use
|
131
|
+
b.use FaradayMiddleware::FollowRedirects
|
132
132
|
b.adapter :net_http
|
133
133
|
end
|
134
134
|
|
@@ -18,11 +18,11 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
20
|
s.add_dependency "faraday", ">= 1.0"
|
21
|
-
s.add_dependency "geoblacklight", "
|
21
|
+
s.add_dependency "geoblacklight", "~> 3.8"
|
22
22
|
s.add_dependency "image_processing", "~> 1.6"
|
23
23
|
s.add_dependency "mimemagic", "~> 0.3"
|
24
24
|
s.add_dependency "mini_magick", "~> 4.9.4"
|
25
|
-
s.add_dependency "rails", ">= 5.2", "< 7.
|
25
|
+
s.add_dependency "rails", ">= 5.2", "< 7.3"
|
26
26
|
s.add_dependency "statesman", ">= 3.4"
|
27
27
|
|
28
28
|
s.add_development_dependency "byebug"
|
@@ -36,7 +36,7 @@ namespace :gblsci do
|
|
36
36
|
results.docs.each do |document|
|
37
37
|
sleep(1)
|
38
38
|
begin
|
39
|
-
GeoblacklightSidecarImages::StoreImageJob.perform_later(document
|
39
|
+
GeoblacklightSidecarImages::StoreImageJob.perform_later(document["layer_slug_s"])
|
40
40
|
rescue Blacklight::Exceptions::RecordNotFound
|
41
41
|
next
|
42
42
|
end
|
@@ -1,20 +1,20 @@
|
|
1
1
|
{
|
2
2
|
"geoblacklight_version": "1.0",
|
3
|
-
"dc_description_s": "This map
|
3
|
+
"dc_description_s": "This map presents a digital version of the Operational Navigation Charts (ONC) at 1:1,000,000-scale, produced by the US National Geospatial-Intelligence Agency (NGA). The map includes over 200 charts across the world, excluding parts of North America, Europe, Asia, and Oceania where charts are not publicly available. For more information on this map, including the terms of use, visit us online.",
|
4
4
|
"dc_format_s": "GeoTIFF",
|
5
|
-
"dc_identifier_s": "
|
5
|
+
"dc_identifier_s": "esri-tiled-map-layer",
|
6
6
|
"dc_language_s": "English",
|
7
7
|
"dc_publisher_s": "United States Department of Agriculture, Natural Resources Conservation Service",
|
8
8
|
"dc_rights_s": "Public",
|
9
|
-
"dc_title_s": "
|
9
|
+
"dc_title_s": "Specialty/World_Navigation_Charts (MapServer)",
|
10
10
|
"dc_type_s": "Dataset",
|
11
|
-
"dct_references_s": "{\"urn:x-esri:serviceType:ArcGIS#TiledMapLayer\": \"
|
11
|
+
"dct_references_s": "{\"urn:x-esri:serviceType:ArcGIS#TiledMapLayer\": \"https://services.arcgisonline.com/arcgis/rest/services/Specialty/World_Navigation_Charts/MapServer\"}",
|
12
12
|
"dct_temporal_sm": [
|
13
|
-
"
|
13
|
+
"2013"
|
14
14
|
],
|
15
15
|
"dct_provenance_s": "NYU",
|
16
|
-
"layer_slug_s": "
|
17
|
-
"layer_id_s": "
|
16
|
+
"layer_slug_s": "esri-tiled-map-layer",
|
17
|
+
"layer_id_s": "esri-tiled-map-layer",
|
18
18
|
"layer_geom_type_s": "Raster",
|
19
19
|
"layer_modified_dt": "2015-06-16T00:59:49Z",
|
20
20
|
"solr_geom": "ENVELOPE(-129.4956, -64.4393, 48.6336, 21.8079)",
|
@@ -3,27 +3,70 @@
|
|
3
3
|
require "rails_helper"
|
4
4
|
|
5
5
|
describe GeoblacklightSidecarImages::ImageService do
|
6
|
+
# Dynamic Map Layer
|
7
|
+
let(:dynamic_map_document) { SolrDocument.new(json_data("esri-dynamic-layer-all-layers")) }
|
8
|
+
let(:dynamic_map_imgsvc) { described_class.new(dynamic_map_document) }
|
9
|
+
|
10
|
+
# IIIF
|
6
11
|
let(:iiif_document) { SolrDocument.new(json_data("umich_iiif_jpg")) }
|
7
12
|
let(:iiif_imgsvc) { described_class.new(iiif_document) }
|
8
|
-
|
13
|
+
|
14
|
+
# Image Map Layer
|
15
|
+
let(:image_map_document) { SolrDocument.new(json_data("esri-image-map-layer")) }
|
16
|
+
let(:image_map_imgsvc) { described_class.new(image_map_document) }
|
17
|
+
|
18
|
+
# WMS
|
19
|
+
let(:wms_document) { SolrDocument.new(json_data("actual-polygon1")) }
|
9
20
|
let(:wms_imgsvc) { described_class.new(wms_document) }
|
21
|
+
|
22
|
+
# Thumbnail
|
10
23
|
let(:thumb_document) { SolrDocument.new(json_data("umn_solr_thumb")) }
|
11
24
|
let(:thumb_imgsvc) { described_class.new(thumb_document) }
|
12
|
-
let(:map_document) { SolrDocument.new(json_data("b1g_thumbnail")) }
|
13
|
-
let(:map_imgsvc) { described_class.new(map_document) }
|
14
25
|
|
15
|
-
#
|
26
|
+
# Tiled Map Layer
|
27
|
+
let(:tiled_map_document) { SolrDocument.new(json_data("esri-tiled_map_layer")) }
|
28
|
+
let(:tiled_map_imgsvc) { described_class.new(tiled_map_document) }
|
16
29
|
|
17
30
|
describe "#store" do
|
18
31
|
it "responds to store" do
|
19
32
|
expect(iiif_imgsvc).to respond_to(:store)
|
20
33
|
end
|
21
34
|
|
22
|
-
it "stores
|
35
|
+
it "stores a Dynamic Map Layer" do
|
36
|
+
# Doc: 90f14ff4-1359-4beb-b931-5cb41d20ab90
|
37
|
+
dynamic_map_imgsvc.store
|
38
|
+
expect(dynamic_map_imgsvc.document.sidecar.image_state.current_state).to eq("succeeded")
|
39
|
+
end
|
40
|
+
|
41
|
+
it "stores a IIIF image" do
|
42
|
+
# Doc: 3ffb1f2e-d617-4361-bc2b-49d9ad270cad
|
23
43
|
iiif_imgsvc.store
|
24
44
|
expect(iiif_imgsvc.document.sidecar.image_state.current_state).to eq("succeeded")
|
25
45
|
end
|
26
46
|
|
47
|
+
it "stores an Image Map Layer" do
|
48
|
+
# Doc: 32653ed6-8d83-4692-8a06-bf13ffe2c018
|
49
|
+
image_map_imgsvc.store
|
50
|
+
expect(image_map_imgsvc.document.sidecar.image_state.current_state).to eq("succeeded")
|
51
|
+
end
|
52
|
+
|
53
|
+
it "stores a Thumbnail" do
|
54
|
+
thumb_imgsvc.store
|
55
|
+
expect(thumb_imgsvc.document.sidecar.image_state.current_state).to eq("succeeded")
|
56
|
+
end
|
57
|
+
|
58
|
+
it "stores a Tiled Map Layer" do
|
59
|
+
# Doc: esri-tiled-map-layer
|
60
|
+
tiled_map_imgsvc.store
|
61
|
+
expect(tiled_map_imgsvc.document.sidecar.image_state.current_state).to eq("succeeded")
|
62
|
+
end
|
63
|
+
|
64
|
+
it "stores a WMS image" do
|
65
|
+
# Doc: tufts-cambridgegrid100-04
|
66
|
+
wms_imgsvc.store
|
67
|
+
expect(wms_imgsvc.document.sidecar.image_state.current_state).to eq("succeeded")
|
68
|
+
end
|
69
|
+
|
27
70
|
it "prioritizes settings thumbnail field" do
|
28
71
|
expect(thumb_imgsvc.send(:gblsi_thumbnail_field?)).to be_truthy
|
29
72
|
end
|
@@ -37,12 +80,12 @@ describe GeoblacklightSidecarImages::ImageService do
|
|
37
80
|
end
|
38
81
|
|
39
82
|
it "returns references without a settings thumbnail field value" do
|
40
|
-
|
83
|
+
skip "MIT fixture is not working."
|
41
84
|
expect(wms_imgsvc.send(:image_url)).to include "wms"
|
42
85
|
end
|
43
86
|
|
44
87
|
it "returns no service_url when settings thumbnail field" do
|
45
|
-
expect(
|
88
|
+
expect(thumb_imgsvc.send(:service_url)).to be_falsey
|
46
89
|
end
|
47
90
|
end
|
48
91
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geoblacklight_sidecar_images
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Larson
|
8
8
|
- Eliot Jordan
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-08-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -29,16 +29,16 @@ dependencies:
|
|
29
29
|
name: geoblacklight
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '3.
|
34
|
+
version: '3.8'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '3.
|
41
|
+
version: '3.8'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: image_processing
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
version: '5.2'
|
91
91
|
- - "<"
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '7.
|
93
|
+
version: '7.3'
|
94
94
|
type: :runtime
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
version: '5.2'
|
101
101
|
- - "<"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '7.
|
103
|
+
version: '7.3'
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: statesman
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -269,7 +269,7 @@ dependencies:
|
|
269
269
|
- - "~>"
|
270
270
|
- !ruby/object:Gem::Version
|
271
271
|
version: '1.24'
|
272
|
-
description:
|
272
|
+
description:
|
273
273
|
email:
|
274
274
|
- ewlarson@gmail.com
|
275
275
|
executables: []
|
@@ -394,7 +394,7 @@ homepage: https://github.com/geoblacklight/geoblacklight_sidecar_images
|
|
394
394
|
licenses:
|
395
395
|
- Apache 2.0
|
396
396
|
metadata: {}
|
397
|
-
post_install_message:
|
397
|
+
post_install_message:
|
398
398
|
rdoc_options: []
|
399
399
|
require_paths:
|
400
400
|
- lib
|
@@ -409,8 +409,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
409
409
|
- !ruby/object:Gem::Version
|
410
410
|
version: '0'
|
411
411
|
requirements: []
|
412
|
-
rubygems_version: 3.
|
413
|
-
signing_key:
|
412
|
+
rubygems_version: 3.3.3
|
413
|
+
signing_key:
|
414
414
|
specification_version: 4
|
415
415
|
summary: Store local copies of remote imagery in GeoBlacklight
|
416
416
|
test_files: []
|