hidden_hooks 1.0.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +4 -1
- data/hidden_hooks.gemspec +2 -2
- data/lib/hidden_hooks/active_record.rb +7 -0
- data/lib/hidden_hooks/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c3de95afe7b03bb8fc886bb721ef7af2db8d5c8284c7aa7c0d331e33f5b5751
|
4
|
+
data.tar.gz: 02f901e311228c2db78c00c1d6f7cdc6e4ef4b6c56ca048c85c7976a2721170b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d5c2d1346b269bd2f49a45c5cb419ad3cedd239d8f5c2c46fc6f5b95c7ccfe18d5c52f700c63e0a133f4ff81498afbca6917b1449a2e315fcef9dc1024a338f
|
7
|
+
data.tar.gz: f5020d12589ece606c447d45bef122fde445d4136cce36e2120cd9ed23d835615c3cab2f47de1b50d1a9b1fbe2326f97cd08e47f3a47704a3be6f37ee7706fcb
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,20 @@
|
|
8
8
|
### Bug fixes
|
9
9
|
)-->
|
10
10
|
|
11
|
+
## 1.1.1 2025-01-28
|
12
|
+
|
13
|
+
### Bug fixes
|
14
|
+
|
15
|
+
- Removed `around_*` callbacks.
|
16
|
+
- The problem with `around_*` callbacks is that the callback needs to yield to the passed block otherwise the callback chain stops, so if there aren't hooks for a certain callback no one's yielding and the chain always stops.
|
17
|
+
|
18
|
+
## 1.1.0 2025-01-28
|
19
|
+
|
20
|
+
### New features
|
21
|
+
|
22
|
+
- Added transactional callbacks to the Active Record integration.
|
23
|
+
- Added `around_*` callbacks to the Active Record integration.
|
24
|
+
|
11
25
|
## 1.0.0 2025-01-24
|
12
26
|
|
13
27
|
First release. Refer to [README.md](README.md) for the full documentation.
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
A way to defer hooks to reduce dependencies.
|
4
4
|
|
5
|
-
Sometimes we need callbacks that break dependencies. This gem allows to invert those dependencies.
|
5
|
+
Sometimes we need callbacks that break architectural dependencies. This gem allows to invert those dependencies.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -115,6 +115,9 @@ module IssueTracker
|
|
115
115
|
end
|
116
116
|
```
|
117
117
|
|
118
|
+
> [!NOTE]
|
119
|
+
> You can call the hook whatever you want. The only constraint is if you use the [Rails integration](#rails-callbacks), as you see below.
|
120
|
+
|
118
121
|
#### Interface Declaration
|
119
122
|
|
120
123
|
A class `C` declares the interface through `HiddenHooks[C]`. Calling a method on the returned proxy will call every hook that someone else defined, forwarding any argument.
|
data/hidden_hooks.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.license = 'MIT'
|
9
9
|
|
10
10
|
spec.summary = 'A way to defer hooks to reduce dependencies.'
|
11
|
-
spec.description = 'Sometimes we need callbacks that break dependencies. This gem allows to
|
12
|
-
'dependencies.'
|
11
|
+
spec.description = 'Sometimes we need callbacks that break architectural dependencies. This gem allows to ' \
|
12
|
+
'invert those dependencies.'
|
13
13
|
spec.homepage = 'https://github.com/moku-io/hidden_hooks'
|
14
14
|
spec.required_ruby_version = '>= 3.0.0'
|
15
15
|
|
@@ -6,14 +6,21 @@ module HiddenHooks
|
|
6
6
|
|
7
7
|
included do
|
8
8
|
[
|
9
|
+
:after_commit,
|
9
10
|
:after_create,
|
11
|
+
:after_create_commit,
|
10
12
|
:after_destroy,
|
13
|
+
:after_destroy_commit,
|
11
14
|
:after_find,
|
12
15
|
:after_initialize,
|
16
|
+
:after_rollback,
|
13
17
|
:after_save,
|
18
|
+
:after_save_commit,
|
14
19
|
:after_touch,
|
15
20
|
:after_update,
|
21
|
+
:after_update_commit,
|
16
22
|
:after_validation,
|
23
|
+
:before_commit,
|
17
24
|
:before_create,
|
18
25
|
:before_destroy,
|
19
26
|
:before_save,
|
data/lib/hidden_hooks/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hidden_hooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moku S.r.l.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-01-
|
12
|
+
date: 2025-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -25,8 +25,8 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
|
-
description: Sometimes we need callbacks that break dependencies. This
|
29
|
-
to invert those dependencies.
|
28
|
+
description: Sometimes we need callbacks that break architectural dependencies. This
|
29
|
+
gem allows to invert those dependencies.
|
30
30
|
email:
|
31
31
|
- info@moku.io
|
32
32
|
executables: []
|