activefunction-core 0.2.0 → 0.2.2

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: 0b2cfe13205db0147f98083ea9d83b4f6ee0a1a1baaec08f848bf7a650a6e844
4
- data.tar.gz: 136a5559b4c123ba50c384cfaf4beb05a5a9dca14ae398866e9a98a32d72338c
3
+ metadata.gz: 3a045fbb4310661d2138bc88e36d439cc3550ad2cc624ff3926a5fb318b401be
4
+ data.tar.gz: 4998dcbf2e70ccd30faf4dae572c4603eebb7089bf779a1e12722a7f3a1b78c7
5
5
  SHA512:
6
- metadata.gz: 5b2a5470029dc54aab1677f6d08af01d1eaca7673d38003745630a82355e44d810085a66c4f4dbafe50409fb4f2e730e3cacc17384883093943e97169ed4ddfe
7
- data.tar.gz: 8865302a689494285e6ffc23ba6197aca98b2ae6ee3049364c8c0084bfeb3a5507df4e5d3d674277037e5b0621b1a42afacad08d94d2604b13c30a7f496af26c
6
+ metadata.gz: 2dd8fd3d26f7a265de9b86d514697b12d6eda475cafbd06fb09918a0aa67d0b0aed7245b0c785a8689e4d7f3ccf678c6f4522790c4c1084607e06545a9eeff91
7
+ data.tar.gz: aef48c75c71d2b71e72489e63480c5565e445ee0483e42444789303b9f82b217af0d862f7d541699eb1407ac321605c99d0edfda017e05697034eeaed40ba782
data/CHANGELOG.md CHANGED
@@ -11,3 +11,11 @@
11
11
  - Added Plugins support
12
12
  - Added Hooks plugin - refactored ActiveFunction::Functions::Callbacks implementation.
13
13
 
14
+ ## [0.2.1] - Yanked due to invalid .rbnext files
15
+
16
+ - Fixed Plugins options handling
17
+
18
+ ## [0.2.2]
19
+
20
+ - Republish 0.2.1
21
+
@@ -31,7 +31,7 @@ module ActiveFunctionCore
31
31
 
32
32
  private def normalized_options(options, context)
33
33
  options.map do |option|
34
- name, arg = option.first
34
+ name, arg = option
35
35
  -> { context.class.callback_options[name].call(arg, context: context) }
36
36
  end
37
37
  end
@@ -108,7 +108,7 @@ module ActiveFunctionCore
108
108
  # @options options [Symbol] :if the name of the method to check before executing the callback.
109
109
  def set_callback(type, method_name, target, options = {})
110
110
  raise(ArgumentError, "Hook for :#{method_name} is not defined") unless hooks.key?(method_name)
111
- raise(ArgumentError, "Hook Callback accepts only #{options.keys} options") if (options.keys - callback_options.keys).any?
111
+ raise(ArgumentError, "Hook Callback accepts only #{callback_options.keys} options") if (options.keys - callback_options.keys).any?
112
112
 
113
113
  hooks[method_name].add_callback(type: type, target: target, options: options)
114
114
  end
@@ -31,7 +31,7 @@ module ActiveFunctionCore
31
31
 
32
32
  private def normalized_options(options, context)
33
33
  options.map do |option|
34
- name, arg = option.first
34
+ name, arg = option
35
35
  -> { context.class.callback_options[name].call(arg, context: context) }
36
36
  end
37
37
  end
@@ -108,7 +108,7 @@ module ActiveFunctionCore
108
108
  # @options options [Symbol] :if the name of the method to check before executing the callback.
109
109
  def set_callback(type, method_name, target, options = {})
110
110
  raise(ArgumentError, "Hook for :#{method_name} is not defined") unless hooks.key?(method_name)
111
- raise(ArgumentError, "Hook Callback accepts only #{options.keys} options") if (options.keys - callback_options.keys).any?
111
+ raise(ArgumentError, "Hook Callback accepts only #{callback_options.keys} options") if (options.keys - callback_options.keys).any?
112
112
 
113
113
  hooks[method_name].add_callback(type: type, target: target, options: options)
114
114
  end
@@ -31,7 +31,7 @@ module ActiveFunctionCore
31
31
 
32
32
  private def normalized_options(options, context)
33
33
  options.map do |option|
34
- name, arg = option.first
34
+ name, arg = option
35
35
  -> { context.class.callback_options[name].call(arg, context: context) }
36
36
  end
37
37
  end
@@ -108,7 +108,7 @@ module ActiveFunctionCore
108
108
  # @options options [Symbol] :if the name of the method to check before executing the callback.
109
109
  def set_callback(type, method_name, target, options = {})
110
110
  raise(ArgumentError, "Hook for :#{method_name} is not defined") unless hooks.key?(method_name)
111
- raise(ArgumentError, "Hook Callback accepts only #{options.keys} options") if (options.keys - callback_options.keys).any?
111
+ raise(ArgumentError, "Hook Callback accepts only #{callback_options.keys} options") if (options.keys - callback_options.keys).any?
112
112
 
113
113
  hooks[method_name].add_callback(type: type, target: target, options: options)
114
114
  end
@@ -31,7 +31,7 @@ module ActiveFunctionCore
31
31
 
32
32
  private def normalized_options(options, context)
33
33
  options.map do |option|
34
- name, arg = option.first
34
+ name, arg = option
35
35
  -> { context.class.callback_options[name].call(arg, context:) }
36
36
  end
37
37
  end
@@ -108,7 +108,7 @@ module ActiveFunctionCore
108
108
  # @options options [Symbol] :if the name of the method to check before executing the callback.
109
109
  def set_callback(type, method_name, target, options = {})
110
110
  raise(ArgumentError, "Hook for :#{method_name} is not defined") unless hooks.key?(method_name)
111
- raise(ArgumentError, "Hook Callback accepts only #{options.keys} options") if (options.keys - callback_options.keys).any?
111
+ raise(ArgumentError, "Hook Callback accepts only #{callback_options.keys} options") if (options.keys - callback_options.keys).any?
112
112
 
113
113
  hooks[method_name].add_callback(type:, target:, options:)
114
114
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveFunctionCore
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
data/lib/plugins/hooks.rb CHANGED
@@ -31,7 +31,7 @@ module ActiveFunctionCore
31
31
 
32
32
  private def normalized_options(options, context)
33
33
  options.map do |option|
34
- name, arg = option.first
34
+ name, arg = option
35
35
  -> { context.class.callback_options[name].call(arg, context:) }
36
36
  end
37
37
  end
@@ -108,7 +108,7 @@ module ActiveFunctionCore
108
108
  # @options options [Symbol] :if the name of the method to check before executing the callback.
109
109
  def set_callback(type, method_name, target, options = {})
110
110
  raise(ArgumentError, "Hook for :#{method_name} is not defined") unless hooks.key?(method_name)
111
- raise(ArgumentError, "Hook Callback accepts only #{options.keys} options") if (options.keys - callback_options.keys).any?
111
+ raise(ArgumentError, "Hook Callback accepts only #{callback_options.keys} options") if (options.keys - callback_options.keys).any?
112
112
 
113
113
  hooks[method_name].add_callback(type:, target:, options:)
114
114
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activefunction-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nerbyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-next