zen-service 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zen/service/plugins/pluggable.rb +7 -7
- data/lib/zen/service/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4c9b04897987c5d00fe1d73e2c4e4151be3292467ce87ed00317bae09c9d9f2
|
4
|
+
data.tar.gz: 4300a61cfe877b2c7212f7a8cf77da13b7ea0936bc033e0eab6f8f21e4df9138
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e679eada81a3ab7fe338efc42c55e0ee9f8e3fda73e3b7a84ddd9b47e3b83a0ea598931730cf09790167463bcec4310894a6402898817032a280f94df2d2298
|
7
|
+
data.tar.gz: 0ce64d370187a540947d4931c780b3c2fa46b4408aaf229376f988111f26682dc8eeeea1287901fa94a49c4ff50aa49c4c49d9d7fce3bd180a7d2f05439e0531
|
@@ -3,28 +3,28 @@
|
|
3
3
|
module Zen
|
4
4
|
module Service::Plugins
|
5
5
|
module Pluggable
|
6
|
-
def use(name, **opts)
|
6
|
+
def use(name, **opts, &block)
|
7
7
|
extension = Service::Plugins.fetch(name)
|
8
8
|
|
9
9
|
defaults = extension.config[:default_options]
|
10
10
|
opts = defaults.merge(opts) unless defaults.nil?
|
11
11
|
|
12
12
|
if using?(name)
|
13
|
-
extension.configure(self, **opts) if extension.respond_to?(:configure)
|
13
|
+
extension.configure(self, **opts, &block) if extension.respond_to?(:configure)
|
14
14
|
return extension
|
15
15
|
end
|
16
16
|
|
17
|
-
use_extension(extension, name, **opts)
|
17
|
+
use_extension(extension, name, **opts, &block)
|
18
18
|
end
|
19
19
|
|
20
|
-
private def use_extension(extension, name, **opts)
|
20
|
+
private def use_extension(extension, name, **opts, &block)
|
21
21
|
include extension
|
22
22
|
extend extension::ClassMethods if extension.const_defined?(:ClassMethods)
|
23
23
|
|
24
|
-
extension.used(self, **opts) if extension.respond_to?(:used)
|
25
|
-
extension.configure(self, **opts) if extension.respond_to?(:configure)
|
24
|
+
extension.used(self, **opts, &block) if extension.respond_to?(:used)
|
25
|
+
extension.configure(self, **opts, &block) if extension.respond_to?(:configure)
|
26
26
|
|
27
|
-
plugins[name] = Reflection.new(extension, opts)
|
27
|
+
plugins[name] = Reflection.new(extension, opts.merge(block: block))
|
28
28
|
|
29
29
|
extension
|
30
30
|
end
|
data/lib/zen/service/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zen-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Kuzko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.4.10
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Essence of service objects pattern
|