kithe 2.12.0 → 2.14.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6959dccbd0cf4d5d8af7284b8ff0ecb993c4ea46e9346668615a735d826ab642
|
4
|
+
data.tar.gz: '08b25f3f77b972f09e9c58311d75a51018b2d51492c4f62b2c4de3b13f35bbac'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f58424385a86c88f6bfc0005c0d424d4978b4eb4c5a5a5e29b8df5b32695f5afacc8c3a109967cfa3a349d37f314826da35710e8a6eb6aae9a60552d2e732f8d
|
7
|
+
data.tar.gz: 8f10225fc8639e8ef083d55d00d5fa470cd10d193b7aceed9c6f8a7ce24113f00e3b629e9d1f0267f7c8c01f18e772de761216e9a5f74d00512fa761b393cc90
|
@@ -84,6 +84,14 @@ module Kithe
|
|
84
84
|
result["ICC_Profile:ProfileDescription"]
|
85
85
|
end
|
86
86
|
|
87
|
+
def pdf_version
|
88
|
+
result["PDF:PDFVersion"]
|
89
|
+
end
|
90
|
+
|
91
|
+
def page_count
|
92
|
+
result["PDF:PageCount"]
|
93
|
+
end
|
94
|
+
|
87
95
|
# We look in a few places, and we only return date not time because
|
88
96
|
# getting timezone info is unusual, and it's all we need right now.
|
89
97
|
#
|
data/app/models/kithe/model.rb
CHANGED
@@ -27,6 +27,13 @@ class Kithe::Model < ActiveRecord::Base
|
|
27
27
|
|
28
28
|
attr_json_config(default_accepts_nested_attributes: { reject_if: :all_blank })
|
29
29
|
|
30
|
+
# keep json_attributes column out of #inspect display of model shown in logs and
|
31
|
+
# console -- because it can be huge, and is generally duplicated by individual
|
32
|
+
# attributes already included. filter_attributes only supported in Rails 6+
|
33
|
+
if self.respond_to?(:filter_attributes)
|
34
|
+
self.filter_attributes += [:json_attributes]
|
35
|
+
end
|
36
|
+
|
30
37
|
validates_presence_of :title
|
31
38
|
|
32
39
|
# this should only apply to Works, but we define it here so we can preload it
|
@@ -147,6 +154,40 @@ class Kithe::Model < ActiveRecord::Base
|
|
147
154
|
self.leaf_representative_id = result
|
148
155
|
end
|
149
156
|
|
157
|
+
# Insert an after_commit hook that will run BEFORE any existing after_commit hooks,
|
158
|
+
# regardless of Rails version and run_after_transaction_callbacks_in_order_defined configuration.
|
159
|
+
#
|
160
|
+
# Sometimes you need to insert an after_commit hook that goes BEFORE shrine's after_commit
|
161
|
+
# callbacks for promotion in activerecord after_commit
|
162
|
+
#
|
163
|
+
# In Rails prior to 7.1, that happens automatically just by adding an after_commit.
|
164
|
+
# But Rails 7.1 by default changes the order of after_commit AND removes the ability
|
165
|
+
# to alter it with prepend! https://github.com/rails/rails/issues/50118
|
166
|
+
#
|
167
|
+
# We add this method, that will do the right thing -- making sure the new hook we are adding
|
168
|
+
# is run BEFORE any existing ones -- in both Rails < 7.1 and Rails 7.1 with
|
169
|
+
# run_after_transaction_callbacks_in_order_defined
|
170
|
+
#
|
171
|
+
# @example
|
172
|
+
#
|
173
|
+
# class MyAsset < Kithe::Asset
|
174
|
+
# kithe_earlier_after_commit :some_method_to_run_first
|
175
|
+
#
|
176
|
+
# kithe_earlier_after_commit do
|
177
|
+
# # This code will be in an after_commit that comes BEFORE
|
178
|
+
# # any existing ones
|
179
|
+
# end
|
180
|
+
# end
|
181
|
+
#
|
182
|
+
def self.kithe_earlier_after_commit(*args, &block)
|
183
|
+
# confusingly in this state, we need prepend FALSE to have this new callback be registered to go
|
184
|
+
# FIRST. And this actually is correct and works whether or not run_after_transaction_callbacks_in_order_defined
|
185
|
+
# Very confusing, we test thorougly.
|
186
|
+
set_options_for_callbacks!(args, {prepend: false})
|
187
|
+
|
188
|
+
set_callback(:commit, :after, *args, &block)
|
189
|
+
end
|
190
|
+
|
150
191
|
private
|
151
192
|
|
152
193
|
|
data/lib/kithe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kithe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -442,7 +442,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
442
442
|
- !ruby/object:Gem::Version
|
443
443
|
version: '0'
|
444
444
|
requirements: []
|
445
|
-
rubygems_version: 3.
|
445
|
+
rubygems_version: 3.5.11
|
446
446
|
signing_key:
|
447
447
|
specification_version: 4
|
448
448
|
summary: Shareable tools/components for building a digital collections app in Rails.
|