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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b80ac6e8ded571d024d3b299500c905b4f357309e16158aaaeac49ae8301b38b
4
- data.tar.gz: '09fff8a81169c51b7d2af25b935da6d6f5f2db58636b75cdce7d3d386e41eff2'
3
+ metadata.gz: dd8c2ddd29b6cd4330c2e3296304c5af9f03cab9cab7054bed8aab06f85704c9
4
+ data.tar.gz: a4da3067eaa06960911879b277b79ffca2a75caa48043ba6ca2142978e593e71
5
5
  SHA512:
6
- metadata.gz: 52cb834ba4bddb62e298239b218afb71e931d90989c26af79e41388e6989f9d2c02e080b1ca9cfa5f8d6aa21fd5e8a13c5b2b1359560bf2eeae61f7e073ddc5a
7
- data.tar.gz: '0043110884ccd6e21f6f3cdcaf72977db1a7013967be8b433153bc0bce27bdf6e21d480cc42d38f41ff35c2e38c5438363146f6090c8af268bdad2b6bddca9a8'
6
+ metadata.gz: 06f3bd59d943c81109b6f84c3e67d40b2296e329802afd8358b238eccc6004fe6ba354f32771e4eb2a564025640a710762d2f02be459cae09cfc1c077b9775f1
7
+ data.tar.gz: afc504bc9dd5fcb597515404a8e3f50ac7f2f85960a9b3c2e62208b7cb2c91482ee83d03173558c20cfb59b752a0039ecdffbb4b851a8154b5982cc6126bf9d7
@@ -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: 2.7
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: ["3.0","2.7"]
29
- rails_version: [7.0.4.2, 6.1.7.2]
30
- bundler_version: [2.1.1]
31
- faraday_version: ['>= 2', '~> 1.0']
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", ">= 2.0"
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 Geoblacklight::FaradayMiddleware::FollowRedirects
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", ">= 3.3"
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.1"
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"
@@ -12,7 +12,7 @@ module GeoblacklightSidecarImages
12
12
  DESCRIPTION
13
13
 
14
14
  def set_active_storage_processor
15
- app_config = <<-"APP"
15
+ app_config = <<-APP
16
16
 
17
17
  config.active_storage.variant_processor = :mini_magick
18
18
  APP
@@ -12,7 +12,7 @@ module GeoblacklightSidecarImages
12
12
  DESCRIPTION
13
13
 
14
14
  def config_development_jobs_queue_adapter
15
- job_config = <<-"JOBS"
15
+ job_config = <<-JOBS
16
16
  config.active_job.queue_adapter = :inline
17
17
  JOBS
18
18
 
@@ -22,7 +22,7 @@ module GeoblacklightSidecarImages
22
22
  end
23
23
 
24
24
  def include_sidecar_solrdocument
25
- sidecar = <<-"SIDECAR"
25
+ sidecar = <<-SIDECAR
26
26
  def sidecar
27
27
  # Find or create, and set version
28
28
  sidecar = SolrDocumentSidecar.where(
@@ -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.2"
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,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.0
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: 2023-03-03 00:00:00.000000000 Z
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.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.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.1'
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.1'
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.1.4
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: []