geoblacklight_sidecar_images 0.9.0 → 0.9.1

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
  SHA256:
3
- metadata.gz: b80ac6e8ded571d024d3b299500c905b4f357309e16158aaaeac49ae8301b38b
4
- data.tar.gz: '09fff8a81169c51b7d2af25b935da6d6f5f2db58636b75cdce7d3d386e41eff2'
3
+ metadata.gz: 5e5639a7fcc6c46a1279e6e6b14cb56dc63621039508d6c9df8f5543640c45fa
4
+ data.tar.gz: c66f6117ac38255d36421a82b178ee8271f381bc494b085ab93bf7a35d71a1f0
5
5
  SHA512:
6
- metadata.gz: 52cb834ba4bddb62e298239b218afb71e931d90989c26af79e41388e6989f9d2c02e080b1ca9cfa5f8d6aa21fd5e8a13c5b2b1359560bf2eeae61f7e073ddc5a
7
- data.tar.gz: '0043110884ccd6e21f6f3cdcaf72977db1a7013967be8b433153bc0bce27bdf6e21d480cc42d38f41ff35c2e38c5438363146f6090c8af268bdad2b6bddca9a8'
6
+ metadata.gz: b838949ffa7901dea148ff473387949df139a7c1e9106589f398cc1ca5bc447a4ba3d9b3eb813fd3dd6c8ebf473aca425cae716ca906b762d6200d70eb13e9e0
7
+ data.tar.gz: 58d63dd4f5182d9f4a0b2f8b4a448234fcc8a1897c4041f7fdac1d98a04e47591f2edafc667a335eb5da50cd74aa35715855a924d0fbb548253243c3e5627ac9
@@ -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.1.1]
16
+ faraday_version: ['~> 1.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
22
  ruby-version: 2.7
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
 
@@ -28,7 +36,7 @@ jobs:
28
36
  ruby_version: ["3.0","2.7"]
29
37
  rails_version: [7.0.4.2, 6.1.7.2]
30
38
  bundler_version: [2.1.1]
31
- faraday_version: ['>= 2', '~> 1.0']
39
+ faraday_version: ['~> 1.0']
32
40
 
33
41
  name: test ruby ${{ matrix.ruby_version }} / rails ${{ matrix.rails_version }} / faraday ${{ matrix.faraday_version }}
34
42
  steps:
@@ -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 Geoblacklight::FaradayMiddleware::FollowRedirects
131
+ b.use FaradayMiddleware::FollowRedirects
132
132
  b.adapter :net_http
133
133
  end
134
134
 
@@ -18,7 +18,7 @@ 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", ">= 3.3"
21
+ s.add_dependency "geoblacklight", "~> 3.3"
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"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GeoblacklightSidecarImages
4
- VERSION = "0.9.0"
4
+ VERSION = "0.9.1"
5
5
  end
@@ -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.id)
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 shows the Soil Survey Geographic (SSURGO) by the United States Department of Agriculture's Natural Resources Conservation Service. It also shows data that was developed by the National Cooperative Soil Survey and supersedes the State Soil Geographic (STATSGO) dataset published in 1994. SSURGO digitizing duplicates the original soil survey maps. This level of mapping is designed for use by landowners, townships, and county natural resource planning and management. The user should be knowledgeable of soils data and their characteristics. The smallest scale map shows the Global Soil Regions map by the United States Department of Agriculture’s Natural Resources Conservation Service.",
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": "test-soil-survey-map",
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": "Soil Survey Geographic (SSURGO)",
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\": \"http://services.arcgisonline.com/arcgis/rest/services/Specialty/Soil_Survey_Map/MapServer\"}",
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
- "2010"
13
+ "2013"
14
14
  ],
15
15
  "dct_provenance_s": "NYU",
16
- "layer_slug_s": "nyu-test-soil-survey-map",
17
- "layer_id_s": "test-soil-survey_map",
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
- let(:wms_document) { SolrDocument.new(json_data("esri-wms-layer")) }
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
- # @TODO: bdcbcd3e-f6db-4ee4-b7b7-d75fe35f1d92 - Michigan State - thumbnail_path_ss
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 an image" do
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
- pending "MIT fixture is not working."
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(map_imgsvc.send(:service_url)).to be_falsey
88
+ expect(thumb_imgsvc.send(:service_url)).to be_falsey
46
89
  end
47
90
  end
48
91
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoblacklight_sidecar_images
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Larson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-03 00:00:00.000000000 Z
12
+ date: 2023-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -29,14 +29,14 @@ dependencies:
29
29
  name: geoblacklight
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '3.3'
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
41
  version: '3.3'
42
42
  - !ruby/object:Gem::Dependency