iiif_print 3.0.3 → 3.0.4

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: 1751ae8fa40b3eea80a42e190c97e2edb777559907b47e1e3b781f82db383137
4
- data.tar.gz: 59f9138ca7c4364eaaf886d0856ed8ac00c21a6a58d5ab6193f924681cd85add
3
+ metadata.gz: 424c547bda36b69486e37cb77a20db7589461661ea4a0d28a40f253deb67c8ba
4
+ data.tar.gz: b60819a280d68aa91750303ffb7dc36d1933782c7530669e72821c66bf7cdbfe
5
5
  SHA512:
6
- metadata.gz: '061086f0d3283d48aa2c5b518766cc05d88000174dc555936cccf0a5c345abdc27a648055e1865ccf3acf791789ce767962176e9711d96101f33b4ef02294b53'
7
- data.tar.gz: 8c876a9db0b6bd4024aebcec8118f5f101d1208d3a13388d608202ace3183b0e6c2fc7fdaef0870bb95a46623aeee151515cc0f6272f4981d35f2d18c98228af
6
+ metadata.gz: 1ca32d96012dddbb1a9a113e1cee089165ce19401f4739c11e1e82b0580f5e5bd30f492732755c809f7d7f46fc7e9d8f6f491a2c5425c1de1cd2460a90bbb614
7
+ data.tar.gz: 43fe8f6658bcaa7001d9c0696ea3ff7c270168e7b3200c9f8ab5ce5c148987b23a9060c82aac64edbb356e0f49942ce175301a98b89147f531780f9547febf8b
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.4)
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.1.0)
69
69
  activerecord (>= 4.2)
70
70
  activestorage (5.2.8.1)
71
71
  actionpack (= 5.2.8.1)
@@ -87,20 +87,21 @@ GEM
87
87
  awesome_nested_set (3.8.0)
88
88
  activerecord (>= 4.0.0, < 8.1)
89
89
  aws-eventstream (1.3.0)
90
- aws-partitions (1.1044.0)
91
- aws-sdk-core (3.217.1)
90
+ aws-partitions (1.1048.0)
91
+ aws-sdk-core (3.218.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-kms (1.98.0)
97
98
  aws-sdk-core (~> 3, >= 3.216.0)
98
99
  aws-sigv4 (~> 1.5)
99
- aws-sdk-s3 (1.179.0)
100
+ aws-sdk-s3 (1.180.0)
100
101
  aws-sdk-core (~> 3, >= 3.216.0)
101
102
  aws-sdk-kms (~> 1)
102
103
  aws-sigv4 (~> 1.5)
103
- aws-sdk-sqs (1.91.0)
104
+ aws-sdk-sqs (1.92.0)
104
105
  aws-sdk-core (~> 3, >= 3.216.0)
105
106
  aws-sigv4 (~> 1.5)
106
107
  aws-sigv4 (1.11.0)
@@ -579,7 +580,7 @@ GEM
579
580
  mime-types (3.6.0)
580
581
  logger
581
582
  mime-types-data (~> 3.2015)
582
- mime-types-data (3.2025.0107)
583
+ mime-types-data (3.2025.0204)
583
584
  mini_magick (4.13.2)
584
585
  mini_mime (1.1.5)
585
586
  mini_portile2 (2.8.5)
@@ -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?
@@ -86,7 +86,7 @@ module IiifPrint
86
86
  # Building a custom query to find these child works directly via the attribute would be more efficient.
87
87
  # However, it would require more effort for a lesser-used feature, and would not allow for the fallback
88
88
  # of finding child works by title.
89
- # rubocop:disable Lint/UnusedMethodArgument
89
+ # rubocop:disable Lint/UnusedMethodArgument, Metrics/AbcSize, Metrics/MethodLength
90
90
  def self.destroy_children_split_from(file_set:, work:, model:, user:)
91
91
  all_child_works = Hyrax.custom_queries.find_child_works(resource: work)
92
92
  return if all_child_works.blank?
@@ -97,6 +97,15 @@ module IiifPrint
97
97
  children = all_child_works.select { |m| m.title.include?(file_set.label) && m.title.include?(work.to_param) }
98
98
  end
99
99
  return if children.blank?
100
+ # we have to update the work's members first, then delete the children
101
+ # otherwise Hyrax tries to save the parent as each child is deleted, resulting
102
+ # in failing jobs
103
+ remaining_members = work.member_ids - children.map(&:id)
104
+ work.member_ids = remaining_members
105
+ Hyrax.persister.save(resource: work)
106
+ Hyrax.index_adapter.save(resource: work)
107
+ Hyrax.publisher.publish('object.membership.updated', object: work, user: user)
108
+
100
109
  children.each do |rcd|
101
110
  Hyrax.persister.delete(resource: rcd)
102
111
  Hyrax.index_adapter.delete(resource: rcd)
@@ -104,7 +113,7 @@ module IiifPrint
104
113
  end
105
114
  true
106
115
  end
107
- # rubocop:enable Lint/UnusedMethodArgument
116
+ # rubocop:enable Lint/UnusedMethodArgument, Metrics/AbcSize, Metrics/MethodLength
108
117
 
109
118
  def self.pdf?(file_set)
110
119
  file_set.original_file&.pdf?
@@ -1,3 +1,3 @@
1
1
  module IiifPrint
2
- VERSION = '3.0.3'.freeze
2
+ VERSION = '3.0.4'.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.4
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-02-07 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: blacklight_iiif_search