hooksmith 0.1.0 → 0.1.1

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: ef153cc049df6fb2994b69e8e7fc5a260c1cb57262a7157871b36baf38aff34d
4
- data.tar.gz: a0fb98c2d45e68e4adca1bbd0fc9a3ed44747cff6aa8f56b78ef1bcc6222d4d3
3
+ metadata.gz: f854886a5db2a889088434912c1ee095998ec9cf1c6f1fab8a516e4d9de3fe2a
4
+ data.tar.gz: 3cfe3db3c0746db88d5d3cf8a9f4b40e5fcecd5f1e204f74eaea7123aca1f6a6
5
5
  SHA512:
6
- metadata.gz: 7bfdc41f3a150ebb6c9ee9685ee22f3d8d3eabbd0314dbb0a42b855f41ead9a3277d0fe8049aef6b05034c6efa540cd17a5d017906b5432000af3f8532a7513b
7
- data.tar.gz: bcd1dd3624624bdfcc288591b1cfde025c3ccfce80f71fcbc649ee8119b2f143bf00c5edc899c7db3b4acf0572d0ebbd802909663a3231c215c645971ceb4b95
6
+ metadata.gz: eed80e32167d30bad4ddcfd39483517ba61ec5c8644cd71e9bc0a2b6d9bc138b937c0699034b686358155145705dc0d2fd3f731d4ce5a23eb4e59d66c798be6d
7
+ data.tar.gz: 48fa0d24f3b0e6f236c69eb809d71ec2b689c63eca38760484283459048bb6df5d5b0e7fc240306a204c41a68a3a60d21d064f1c86577f473f26fb61686b23f9
Binary file
@@ -27,9 +27,9 @@ module Hooksmith
27
27
  #
28
28
  # @param provider [Symbol, String] the provider name
29
29
  # @param event [Symbol, String] the event name
30
- # @param processor_class [Class] the processor class
31
- def register_processor(provider, event, processor_class)
32
- registry[provider.to_sym] << { event: event.to_sym, processor: processor_class }
30
+ # @param processor_class_name [String] the processor class name
31
+ def register_processor(provider, event, processor_class_name)
32
+ registry[provider.to_sym] << { event: event.to_sym, processor: processor_class_name }
33
33
  end
34
34
 
35
35
  # Returns all processor entries for a given provider and event.
@@ -57,9 +57,9 @@ module Hooksmith
57
57
  # Registers a processor for a specific event.
58
58
  #
59
59
  # @param event [Symbol, String] the event name.
60
- # @param processor_class [Class] the processor class.
61
- def register(event, processor_class)
62
- entries << { event: event.to_sym, processor: processor_class }
60
+ # @param processor_class_name [String] the processor class name.
61
+ def register(event, processor_class_name)
62
+ entries << { event: event.to_sym, processor: processor_class_name }
63
63
  end
64
64
  end
65
65
  end
@@ -33,7 +33,7 @@ module Hooksmith
33
33
 
34
34
  # Instantiate each processor and filter by condition.
35
35
  matching_processors = entries.map do |entry|
36
- processor = entry[:processor].new(@payload)
36
+ processor = Object.const_get(entry[:processor]).new(@payload)
37
37
  processor if processor.can_handle?(@payload)
38
38
  end.compact
39
39
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hooksmith
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooksmith
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - gregoryrivage
@@ -10,6 +10,10 @@ cert_chain: []
10
10
  date: 2025-03-12 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Hooksmith is a gem that allows you to handle webhooks in your Rails application.
13
+ It provides a simple and flexible way to receive, validate, and process webhooks
14
+ from various services. With Hooksmith, you can easily configure webhook endpoints,
15
+ handle authentication, retry failed webhooks, and manage webhook payloads in a consistent
16
+ manner.
13
17
  email:
14
18
  - gregory@rivage.immo
15
19
  executables: []
@@ -23,6 +27,7 @@ files:
23
27
  - LICENSE.txt
24
28
  - README.md
25
29
  - Rakefile
30
+ - hooksmith-0.1.0.gem
26
31
  - lib/hooksmith.rb
27
32
  - lib/hooksmith/configuration.rb
28
33
  - lib/hooksmith/dispatcher.rb