activestorage-after_analyze_attached 0.1.0 → 0.2.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 +4 -4
- data/README.md +3 -0
- data/lib/activestorage/after_analyze_attached/version.rb +1 -1
- data/lib/activestorage/after_analyze_attached.rb +6 -6
- metadata +17 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5122ca221d7fb657c4ed20ae62596c636149c855c233630485477f8d015d4ee2
|
4
|
+
data.tar.gz: 194ab602aa399ba701f182bd33df861627306605b42fd92fed95c4524a667205
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3361c5177ca9d6694fafe391bda9013c15c56d07685e1db206d50c2dd404bd823f518dc967a180bc580fceff0d90d94e85931ae16b02627c2c68ff40a0c44ecd
|
7
|
+
data.tar.gz: 626e534f090e6233139598e182f21c0ef60ec9783e470313e5b5dd6636be5fcb494cd6d255cee80b868ad8d56b4ec01d171c8200c23ab913e7e98ae715e4f4e4
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Activestorage::AfterAnalyzeAttached
|
2
2
|
|
3
|
+
[](https://github.com/frayzil/activestorage-after_analyze_attached/actions/workflows/ci.yml)
|
4
|
+
[](https://github.com/frayzil/activestorage-after_analyze_attached/actions/workflows/ci.yml)
|
5
|
+
|
3
6
|
A Rails gem that provides a callback for when Active Storage attachments are analyzed. This is particularly useful when you need to perform actions after Active Storage has analyzed an attachment, such as updating flags, triggering background jobs, or updating the UI.
|
4
7
|
|
5
8
|
## Why use this gem?
|
@@ -28,12 +28,12 @@ module ActiveStorage::AfterAnalyzeAttached
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def blob_analyzed(blob)
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
attachments = ActiveStorage::Attachment.where(blob: blob)
|
32
|
+
attachments.each do |attachment|
|
33
|
+
attachment_name = attachment.name.to_sym
|
34
|
+
callbacks = self.class.after_analyze_attached_callbacks[attachment_name]
|
35
|
+
callbacks.each { |callback| instance_exec(attachment, blob, &callback) }
|
36
|
+
end
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activestorage-after_analyze_attached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Syed Fazil Basheer
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-
|
10
|
+
date: 2025-04-20 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rails
|
@@ -24,6 +23,20 @@ dependencies:
|
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: 8.0.1
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: simplecov
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - "~>"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.22.0
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.22.0
|
27
40
|
description: This gem extends ActiveStorage to provide an after_analyze callback that
|
28
41
|
gets triggered after analyzing an attachment
|
29
42
|
email:
|
@@ -47,7 +60,6 @@ metadata:
|
|
47
60
|
homepage_uri: https://github.com/frayzil/activestorage-after_analyze_attached
|
48
61
|
source_code_uri: https://github.com/frayzil/activestorage-after_analyze_attached
|
49
62
|
changelog_uri: https://github.com/frayzil/activestorage-after_analyze_attached/blob/main/CHANGELOG.md
|
50
|
-
post_install_message:
|
51
63
|
rdoc_options: []
|
52
64
|
require_paths:
|
53
65
|
- lib
|
@@ -62,8 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
74
|
- !ruby/object:Gem::Version
|
63
75
|
version: '0'
|
64
76
|
requirements: []
|
65
|
-
rubygems_version: 3.
|
66
|
-
signing_key:
|
77
|
+
rubygems_version: 3.6.2
|
67
78
|
specification_version: 4
|
68
79
|
summary: Adds after_analyze callback to ActiveStorage attachments
|
69
80
|
test_files: []
|