zaikio-webhooks 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 +1 -1
- data/app/controllers/zaikio/webhooks/webhooks_controller.rb +1 -1
- data/lib/zaikio/webhooks/event.rb +2 -0
- data/lib/zaikio/webhooks/version.rb +1 -1
- data/lib/zaikio/webhooks.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1041992660107d3cd89e5a14f95251a24163adf6a2933e9cad959f1827e1b06
|
4
|
+
data.tar.gz: 73a2c6ad3b1eece070faf9aafe0217991cf4b4bb89284c49c05a02f333c2400c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c987086f8a0dd42f0fc273646f9519fd1a162816339b0056d25f20246202888afce2ff97cbe8ffd2b2ac086cf65f845d69772641b63801f242e45789ffa69ba
|
7
|
+
data.tar.gz: 4ac9e4e65fa8abc15e0860bfc980b625948894e31443d8ff1c5573f8956f559a000e746690d5bf4a9a83e659a4bc7ac7af61731caa6fcc4d4b25180042962521
|
data/README.md
CHANGED
@@ -96,7 +96,7 @@ Rails.application.reloader.to_prepare do
|
|
96
96
|
perform_now: true
|
97
97
|
# Only for a specific client
|
98
98
|
Zaikio::Webhooks.on "directory.machine_added", AddMachineJob,
|
99
|
-
client_name: :my_app
|
99
|
+
client_name: :my_app, options: { custom_keyword_argument_for_job: "value" }
|
100
100
|
end
|
101
101
|
```
|
102
102
|
|
@@ -8,7 +8,7 @@ module Zaikio
|
|
8
8
|
Zaikio::Webhooks.webhooks_for(params[:client_name], event_params[:name])
|
9
9
|
.each do |job_klass, options|
|
10
10
|
job_klass.public_send(options[:perform_now] ? :perform_now : :perform_later,
|
11
|
-
Zaikio::Webhooks::Event.new(event_params))
|
11
|
+
Zaikio::Webhooks::Event.new(event_params), **options[:options])
|
12
12
|
end
|
13
13
|
|
14
14
|
head :ok
|
data/lib/zaikio/webhooks.rb
CHANGED
@@ -35,7 +35,7 @@ module Zaikio
|
|
35
35
|
(@webhooks.dig(client_name.to_s, event_name.to_s) || {})
|
36
36
|
end
|
37
37
|
|
38
|
-
def on(event_name, job_klass, client_name: nil, perform_now: false)
|
38
|
+
def on(event_name, job_klass, client_name: nil, perform_now: false, options: {})
|
39
39
|
@webhooks ||= {}
|
40
40
|
|
41
41
|
after_configuration do
|
@@ -44,7 +44,8 @@ module Zaikio
|
|
44
44
|
@webhooks[name] ||= {}
|
45
45
|
@webhooks[name][event_name.to_s] ||= {}
|
46
46
|
@webhooks[name][event_name.to_s][job_klass] = {
|
47
|
-
perform_now: perform_now
|
47
|
+
perform_now: perform_now,
|
48
|
+
options: options
|
48
49
|
}
|
49
50
|
end
|
50
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zaikio-webhooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zaikio GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|