iiif_print 3.0.3 → 3.0.5

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
  SHA256:
3
- metadata.gz: 1751ae8fa40b3eea80a42e190c97e2edb777559907b47e1e3b781f82db383137
4
- data.tar.gz: 59f9138ca7c4364eaaf886d0856ed8ac00c21a6a58d5ab6193f924681cd85add
3
+ metadata.gz: cdd66a6eb68613bdd610b0cb87092a6d7a9bee69c2f6f015ddb8035e0c8fa5e0
4
+ data.tar.gz: 8669cf9f172800e1069f096ff1c98409fd44f4e0607722423dc6fdaf4961a5a8
5
5
  SHA512:
6
- metadata.gz: '061086f0d3283d48aa2c5b518766cc05d88000174dc555936cccf0a5c345abdc27a648055e1865ccf3acf791789ce767962176e9711d96101f33b4ef02294b53'
7
- data.tar.gz: 8c876a9db0b6bd4024aebcec8118f5f101d1208d3a13388d608202ace3183b0e6c2fc7fdaef0870bb95a46623aeee151515cc0f6272f4981d35f2d18c98228af
6
+ metadata.gz: a4ebe41e069d13a860e0b7b19cda249763d4b31405be767cd41f2b48ec9e34117edd2a4dacd157c93c7b964dc1b1cdc2ea6cfa1a89704cb38399775c185f6eb9
7
+ data.tar.gz: c2de71552f311ae3961de7cb88bdd890f89bc970a896ee151150d2633f17fab3378513b62b97311989afe8903e5e4d2e8ef9a6ac428efad44abb57f23fe96054
data/CONTRIBUTING.md CHANGED
@@ -172,6 +172,20 @@ This is your chance for a mentoring moment of another developer. Take time to gi
172
172
  - Did the Continuous Integration tests complete successfully?
173
173
 
174
174
  If you are uncertain, bring other contributors into the conversation by assigning them as a reviewer.
175
+ ### Release a New Gem Version
176
+
177
+ After all changes are merged:
178
+ - Pull the newest code to your local repo, and rebuild docker if needed.
179
+ - Run `bundle exec rake` to verify that rubocop and specs pass.
180
+ - Update the tag in the version file, and bundle.
181
+ - Create a PR with the updated version & Gemfile.lock file.
182
+ - Merge into main.
183
+ - Create a new release & tag on github with this new version number.
184
+ - Pull main to your local repo to get the release & tag.
185
+ - Inside your docker container, run `bundle exec rake release`. This will build the gem and push it to rubygems.org.
186
+
187
+ (Note, you must have configured your rubygems login previously for this to work).
188
+ It may be possible to build the gem outside of docker, but this requires the ability to bundle outside of docker which can be very problematic.
175
189
 
176
190
  # Additional Resources
177
191
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: /app/samvera/hyrax-webapp
3
3
  specs:
4
- iiif_print (3.0.3)
4
+ iiif_print (3.0.5)
5
5
  blacklight_iiif_search (>= 1.0, < 3.0)
6
6
  derivative-rodeo (~> 0.5)
7
7
  hyrax (>= 2.5, < 6)
@@ -65,7 +65,7 @@ GEM
65
65
  activemodel (= 5.2.8.1)
66
66
  activesupport (= 5.2.8.1)
67
67
  arel (>= 9.0)
68
- activerecord-import (2.0.0)
68
+ activerecord-import (2.2.0)
69
69
  activerecord (>= 4.2)
70
70
  activestorage (5.2.8.1)
71
71
  actionpack (= 5.2.8.1)
@@ -86,36 +86,38 @@ GEM
86
86
  execjs (~> 2)
87
87
  awesome_nested_set (3.8.0)
88
88
  activerecord (>= 4.0.0, < 8.1)
89
- aws-eventstream (1.3.0)
90
- aws-partitions (1.1044.0)
91
- aws-sdk-core (3.217.1)
89
+ aws-eventstream (1.4.0)
90
+ aws-partitions (1.1112.0)
91
+ aws-sdk-core (3.225.1)
92
92
  aws-eventstream (~> 1, >= 1.3.0)
93
93
  aws-partitions (~> 1, >= 1.992.0)
94
94
  aws-sigv4 (~> 1.9)
95
+ base64
95
96
  jmespath (~> 1, >= 1.6.1)
96
- aws-sdk-kms (1.97.0)
97
- aws-sdk-core (~> 3, >= 3.216.0)
97
+ logger
98
+ aws-sdk-kms (1.103.0)
99
+ aws-sdk-core (~> 3, >= 3.225.0)
98
100
  aws-sigv4 (~> 1.5)
99
- aws-sdk-s3 (1.179.0)
100
- aws-sdk-core (~> 3, >= 3.216.0)
101
+ aws-sdk-s3 (1.189.0)
102
+ aws-sdk-core (~> 3, >= 3.225.0)
101
103
  aws-sdk-kms (~> 1)
102
104
  aws-sigv4 (~> 1.5)
103
- aws-sdk-sqs (1.91.0)
104
- aws-sdk-core (~> 3, >= 3.216.0)
105
+ aws-sdk-sqs (1.96.0)
106
+ aws-sdk-core (~> 3, >= 3.225.0)
105
107
  aws-sigv4 (~> 1.5)
106
- aws-sigv4 (1.11.0)
108
+ aws-sigv4 (1.12.0)
107
109
  aws-eventstream (~> 1, >= 1.0.2)
108
110
  babel-source (5.8.35)
109
111
  babel-transpiler (0.7.0)
110
112
  babel-source (>= 4.0, < 6)
111
113
  execjs (~> 2.0)
112
114
  backport (1.2.0)
113
- base64 (0.2.0)
115
+ base64 (0.3.0)
114
116
  bcp47 (0.3.3)
115
117
  i18n
116
118
  bcrypt (3.1.20)
117
119
  benchmark (0.3.0)
118
- bigdecimal (3.1.9)
120
+ bigdecimal (3.2.2)
119
121
  bindex (0.8.1)
120
122
  bixby (5.0.2)
121
123
  rubocop (= 1.28.2)
@@ -177,7 +179,7 @@ GEM
177
179
  execjs
178
180
  coffee-script-source (1.12.2)
179
181
  concurrent-ruby (1.2.2)
180
- connection_pool (2.5.0)
182
+ connection_pool (2.5.3)
181
183
  coveralls (0.8.23)
182
184
  json (>= 1.8, < 3)
183
185
  simplecov (~> 0.16.1)
@@ -185,7 +187,7 @@ GEM
185
187
  thor (>= 0.19.4, < 2.0)
186
188
  tins (~> 1.6)
187
189
  crass (1.0.6)
188
- csv (3.3.2)
190
+ csv (3.3.5)
189
191
  database_cleaner (1.99.0)
190
192
  date (3.3.4)
191
193
  declarative (0.0.20)
@@ -344,12 +346,13 @@ GEM
344
346
  hashie (5.0.0)
345
347
  hiredis (0.6.3)
346
348
  htmlentities (4.3.4)
347
- http_logger (0.7.0)
348
- httparty (0.22.0)
349
+ http_logger (1.0.1)
350
+ httparty (0.23.1)
349
351
  csv
350
352
  mini_mime (>= 1.0.0)
351
353
  multi_xml (>= 0.5.2)
352
- httpclient (2.8.3)
354
+ httpclient (2.9.0)
355
+ mutex_m
353
356
  hydra-access-controls (11.0.7)
354
357
  active-fedora (>= 10.0.0)
355
358
  activesupport (>= 4, < 6)
@@ -561,7 +564,7 @@ GEM
561
564
  shex (~> 0.6, >= 0.6.4)
562
565
  sparql (~> 3.1, >= 3.1.8)
563
566
  sparql-client (~> 3.1, >= 3.1.2)
564
- logger (1.6.5)
567
+ logger (1.7.0)
565
568
  loofah (2.22.0)
566
569
  crass (~> 1.0.2)
567
570
  nokogiri (>= 1.12.0)
@@ -576,10 +579,10 @@ GEM
576
579
  marcel (1.0.2)
577
580
  matrix (0.4.2)
578
581
  method_source (1.0.0)
579
- mime-types (3.6.0)
582
+ mime-types (3.7.0)
580
583
  logger
581
- mime-types-data (~> 3.2015)
582
- mime-types-data (3.2025.0107)
584
+ mime-types-data (~> 3.2025, >= 3.2025.0507)
585
+ mime-types-data (3.2025.0603)
583
586
  mini_magick (4.13.2)
584
587
  mini_mime (1.1.5)
585
588
  mini_portile2 (2.8.5)
@@ -587,10 +590,11 @@ GEM
587
590
  multi_json (1.15.0)
588
591
  multi_xml (0.6.0)
589
592
  multipart-post (2.3.0)
593
+ mutex_m (0.3.0)
590
594
  nest (3.2.0)
591
595
  redic
592
- net-http-persistent (4.0.5)
593
- connection_pool (~> 2.2)
596
+ net-http-persistent (4.0.6)
597
+ connection_pool (~> 2.2, >= 2.2.4)
594
598
  net-imap (0.4.6)
595
599
  date
596
600
  net-protocol
@@ -636,7 +640,7 @@ GEM
636
640
  psych (3.3.4)
637
641
  public_suffix (5.1.1)
638
642
  puma (3.12.6)
639
- qa (5.14.0)
643
+ qa (5.15.0)
640
644
  activerecord-import
641
645
  deprecation
642
646
  faraday (< 3.0, != 2.0.0)
@@ -875,9 +879,9 @@ GEM
875
879
  simplecov-html (~> 0.10.0)
876
880
  simplecov-html (0.10.2)
877
881
  slop (4.10.1)
878
- snaky_hash (2.0.1)
879
- hashie
880
- version_gem (~> 1.1, >= 1.1.1)
882
+ snaky_hash (2.0.3)
883
+ hashie (>= 0.1.0, < 6)
884
+ version_gem (>= 1.1.8, < 3)
881
885
  solargraph (0.48.0)
882
886
  backport (~> 1.2)
883
887
  benchmark
@@ -972,7 +976,7 @@ GEM
972
976
  rdf-vocab
973
977
  reform (~> 2.2)
974
978
  reform-rails
975
- version_gem (1.1.4)
979
+ version_gem (1.1.8)
976
980
  warden (1.2.9)
977
981
  rack (>= 2.0.9)
978
982
  web-console (3.7.0)
@@ -62,7 +62,8 @@ module IiifPrint
62
62
  # rubocop:disable Metrics/MethodLength
63
63
  def split_pdf(original_pdf_path, user, child_model, pdf_file_set)
64
64
  user = User.find_by_user_key(user) unless user.is_a?(User)
65
- image_files = @parent_work.iiif_print_config.pdf_splitter_service.call(original_pdf_path)
65
+ # split the pdf into individual pages; pdf_file_set needed for derivative rodeo splitter
66
+ image_files = @parent_work.iiif_print_config.pdf_splitter_service.call(original_pdf_path, file_set: pdf_file_set)
66
67
 
67
68
  # give as much info as possible if we don't have image files to work with.
68
69
  if image_files.blank?
@@ -21,10 +21,12 @@ module IiifPrint
21
21
  # @param work_type [Class<Valkyrie::Resource>]
22
22
  # @return the indexer for the given :work_type
23
23
  def self.decorate_with_adapter_logic(work_type:)
24
- work_type.send(:include, Hyrax::Schema(:child_works_from_pdf_splitting)) unless work_type.included_modules.include?(Hyrax::Schema(:child_works_from_pdf_splitting))
24
+ work_type.send(:include, Hyrax::Schema(:child_works_from_pdf_splitting)) unless
25
+ Hyrax.config.try(:flexible?) || work_type.included_modules.include?(Hyrax::Schema(:child_works_from_pdf_splitting))
25
26
  # TODO: Use `Hyrax::ValkyrieIndexer.indexer_class_for` once changes are merged.
26
27
  indexer = "#{work_type}Indexer".constantize
27
- indexer.send(:include, Hyrax::Indexer(:child_works_from_pdf_splitting)) unless indexer.included_modules.include?(Hyrax::Indexer(:child_works_from_pdf_splitting))
28
+ indexer.send(:include, Hyrax::Indexer(:child_works_from_pdf_splitting)) unless
29
+ Hyrax.config.try(:flexible?) || indexer.included_modules.include?(Hyrax::Indexer(:child_works_from_pdf_splitting))
28
30
  indexer
29
31
  end
30
32
 
@@ -33,7 +35,8 @@ module IiifPrint
33
35
  # @return form for the given :work_type
34
36
  def self.decorate_form_with_adapter_logic(work_type:)
35
37
  form = "#{work_type}Form".constantize
36
- form.send(:include, Hyrax::FormFields(:child_works_from_pdf_splitting)) unless form.included_modules.include?(Hyrax::FormFields(:child_works_from_pdf_splitting))
38
+ form.send(:include, Hyrax::FormFields(:child_works_from_pdf_splitting)) unless
39
+ Hyrax.config.try(:flexible?) || form.included_modules.include?(Hyrax::FormFields(:child_works_from_pdf_splitting))
37
40
  form
38
41
  end
39
42
 
@@ -86,7 +89,7 @@ module IiifPrint
86
89
  # Building a custom query to find these child works directly via the attribute would be more efficient.
87
90
  # However, it would require more effort for a lesser-used feature, and would not allow for the fallback
88
91
  # of finding child works by title.
89
- # rubocop:disable Lint/UnusedMethodArgument
92
+ # rubocop:disable Lint/UnusedMethodArgument, Metrics/AbcSize, Metrics/MethodLength
90
93
  def self.destroy_children_split_from(file_set:, work:, model:, user:)
91
94
  all_child_works = Hyrax.custom_queries.find_child_works(resource: work)
92
95
  return if all_child_works.blank?
@@ -97,6 +100,15 @@ module IiifPrint
97
100
  children = all_child_works.select { |m| m.title.include?(file_set.label) && m.title.include?(work.to_param) }
98
101
  end
99
102
  return if children.blank?
103
+ # we have to update the work's members first, then delete the children
104
+ # otherwise Hyrax tries to save the parent as each child is deleted, resulting
105
+ # in failing jobs
106
+ remaining_members = work.member_ids - children.map(&:id)
107
+ work.member_ids = remaining_members
108
+ Hyrax.persister.save(resource: work)
109
+ Hyrax.index_adapter.save(resource: work)
110
+ Hyrax.publisher.publish('object.membership.updated', object: work, user: user)
111
+
100
112
  children.each do |rcd|
101
113
  Hyrax.persister.delete(resource: rcd)
102
114
  Hyrax.index_adapter.delete(resource: rcd)
@@ -104,7 +116,7 @@ module IiifPrint
104
116
  end
105
117
  true
106
118
  end
107
- # rubocop:enable Lint/UnusedMethodArgument
119
+ # rubocop:enable Lint/UnusedMethodArgument, Metrics/AbcSize, Metrics/MethodLength
108
120
 
109
121
  def self.pdf?(file_set)
110
122
  file_set.original_file&.pdf?
@@ -1,3 +1,3 @@
1
1
  module IiifPrint
2
- VERSION = '3.0.3'.freeze
2
+ VERSION = '3.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iiif_print
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Upton
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2025-01-30 00:00:00.000000000 Z
17
+ date: 2025-06-06 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: blacklight_iiif_search