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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afe0cafc3b91d39c26b6eb9a24e4494b2310301ba94929dc1f49bced4f22b3d9
4
- data.tar.gz: c57a4f0e6f0fb4b7cda8493be297134bc255f607fdab5d4841d12942a835eb2b
3
+ metadata.gz: f4c9b04897987c5d00fe1d73e2c4e4151be3292467ce87ed00317bae09c9d9f2
4
+ data.tar.gz: 4300a61cfe877b2c7212f7a8cf77da13b7ea0936bc033e0eab6f8f21e4df9138
5
5
  SHA512:
6
- metadata.gz: 242f523601adf176f3adeae447c3319123af3d6cf32afd5ee320d7b53c70932874e49e6fd30b92bd1c6c56bf9b675436d6022a165cf276a4c354de20d60996c0
7
- data.tar.gz: 98ad8deaa278b44038b3adfe1284d92919eaa0acfe334cbba1e288844fbf1742dbf9cc43a2d1ba9a9adff5850e4ff680a3afa5055e975ae6c21fa28a963828ab
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Zen
4
4
  class Service
5
- VERSION = "1.0.0"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
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.0.0
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: 2021-03-24 00:00:00.000000000 Z
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.0.3
152
+ rubygems_version: 3.4.10
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Essence of service objects pattern