kithe 2.18.0 → 2.19.0
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 675e05528a33eb6b29c34c8a3c55f19ba82b937d0eb41b61fcc632af0383dee1
|
|
4
|
+
data.tar.gz: 43fd9b34e684e369e910e295d1bca21a00c53c10b0fa2cec0a74323351b09382
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e575adc1d2ae9ab6b7f78d2938468c696a1a5fd37a2d964b1a09ab0b3ef0b85ed15ad25bb4946e6069a79d043efb08449e72203281978617eca3ec5e5eb1343e
|
|
7
|
+
data.tar.gz: 0a645f019d8ff8246d07cc29be08d937e9a2af40974746c557973a907aa36ba0be53cf0b75983a044b30899099fda6ebbfd637c25c48a15d2db2d3c19c969ec4
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module Kithe
|
|
2
|
+
# Can be included in a controller, or usually in ApplicationController for your
|
|
3
|
+
# whole app, to batch solr indexing that takes place in a controller action, into
|
|
4
|
+
# a single or fewer solr index commands.
|
|
5
|
+
#
|
|
6
|
+
# We used to just have implementers write this simple code in thier local app, which
|
|
7
|
+
# works fine, but you wind up with the around filter in all your stack traces, since
|
|
8
|
+
# it's around every action.
|
|
9
|
+
#
|
|
10
|
+
# So instead, just
|
|
11
|
+
#
|
|
12
|
+
# include Kithe::BatchIndexableAroundAction
|
|
13
|
+
#
|
|
14
|
+
# in eg ApplicationController
|
|
15
|
+
#
|
|
16
|
+
module BatchIndexableAroundAction
|
|
17
|
+
extend ActiveSupport::Concern
|
|
18
|
+
|
|
19
|
+
included do
|
|
20
|
+
around_action :_kithe_batch_indexable_around_action
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Used as a Rails controller around_action to batch any kithe indexing directives
|
|
24
|
+
# in a controller action.
|
|
25
|
+
#
|
|
26
|
+
# As `index_with(batching: true)` only creates a Traject::Writer lazily on demand,
|
|
27
|
+
# this should not add appreciable overhead to actions that don't end up triggering any Solr updates.
|
|
28
|
+
def _kithe_batch_indexable_around_action
|
|
29
|
+
Kithe::Indexable.index_with(batching: true) do
|
|
30
|
+
yield
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/lib/kithe/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kithe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.19.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonathan Rochkind
|
|
@@ -360,6 +360,7 @@ files:
|
|
|
360
360
|
- app/characterization/kithe/exiftool_characterization.rb
|
|
361
361
|
- app/characterization/kithe/exiftool_characterization/result.rb
|
|
362
362
|
- app/characterization/kithe/ffprobe_characterization.rb
|
|
363
|
+
- app/controllers/concerns/kithe/batch_indexable_around_action.rb
|
|
363
364
|
- app/derivative_transformers/kithe/ffmpeg_extract_jpg.rb
|
|
364
365
|
- app/derivative_transformers/kithe/ffmpeg_transformer.rb
|
|
365
366
|
- app/derivative_transformers/kithe/vips_cli_image_to_jpeg.rb
|