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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/.rbnext/2.7/plugins/hooks.rb +2 -2
- data/lib/.rbnext/3.0/plugins/hooks.rb +2 -2
- data/lib/.rbnext/3.1/plugins/hooks.rb +2 -2
- data/lib/.rbnext/3.2/plugins/hooks.rb +2 -2
- data/lib/active_function_core/version.rb +1 -1
- data/lib/plugins/hooks.rb +2 -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: 3a045fbb4310661d2138bc88e36d439cc3550ad2cc624ff3926a5fb318b401be
|
4
|
+
data.tar.gz: 4998dcbf2e70ccd30faf4dae572c4603eebb7089bf779a1e12722a7f3a1b78c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dd8fd3d26f7a265de9b86d514697b12d6eda475cafbd06fb09918a0aa67d0b0aed7245b0c785a8689e4d7f3ccf678c6f4522790c4c1084607e06545a9eeff91
|
7
|
+
data.tar.gz: aef48c75c71d2b71e72489e63480c5565e445ee0483e42444789303b9f82b217af0d862f7d541699eb1407ac321605c99d0edfda017e05697034eeaed40ba782
|
data/CHANGELOG.md
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
|
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 #{
|
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
|
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 #{
|
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
|
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 #{
|
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
|
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 #{
|
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
|
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
|
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 #{
|
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.
|
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-
|
11
|
+
date: 2024-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-next
|