resol 0.4.1 → 0.4.2

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: 33dbd02433c7393f8d8f266c695d200183c89353a8b7a8c88ead39fe440e6adf
4
- data.tar.gz: aba889493d6a145d47f34a9aebd85a86802b6e132383fbaf59a1e53e6c814609
3
+ metadata.gz: 0dc5047622a240e207abad9020c3835060ae039eb93fa5f3741896d57871f681
4
+ data.tar.gz: e608a7e82d8c8d54169d305f7b1dbc01a7e1f6088877a05815d7b95979df4da8
5
5
  SHA512:
6
- metadata.gz: 34cc31c049d23bceb945518162b725fc919bd3aae6746d58a90038fe6d678d9ab5c8b4060d6e39a3ae248974973768c97f4ffe5abdcde49bad922081dc6dbf2f
7
- data.tar.gz: aa8c2b3c450dc5b23314a53ed3c65fd662ce3e880b15ca6ab271b5f99a0e05229659c43fd6793ae47b0c7a99f53bcec2541ea025897075cc60ddedda970c1857
6
+ metadata.gz: 9cdd9fe171f117b346c4ebc787451a9def9fc28fbc23f8023852bb2388eb030e3b898dc883864eb0c4b180683c8f4058c74ee4661e856f0d9ce8e55a33cc46e4
7
+ data.tar.gz: 143cd088406f35993f522d3e2549741277eb28fee2b9f99248b86ba9dbd5302b3eee3ec4db9cefbefc8ad8992af64348272e7e09bb068c58b0407df365ce2ce8
data/Gemfile.lock CHANGED
@@ -1,14 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- resol (0.4.1)
4
+ resol (0.4.2)
5
5
  smart_initializer (~> 0.5)
6
- uber (~> 0.1)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
10
9
  specs:
11
- activesupport (6.1.3.1)
10
+ activesupport (6.1.3.2)
12
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
12
  i18n (>= 1.6, < 2)
14
13
  minitest (>= 5.1)
@@ -24,18 +23,18 @@ GEM
24
23
  umbrellio-sequel-plugins (~> 0.4)
25
24
  coderay (1.1.3)
26
25
  colorize (0.8.1)
27
- concurrent-ruby (1.1.8)
26
+ concurrent-ruby (1.1.9)
28
27
  diff-lcs (1.4.4)
29
- docile (1.3.5)
28
+ docile (1.4.0)
30
29
  dry-inflector (0.2.0)
31
30
  i18n (1.8.10)
32
31
  concurrent-ruby (~> 1.0)
33
32
  method_source (1.0.0)
34
33
  minitest (5.14.4)
35
34
  parallel (1.20.1)
36
- parser (3.0.1.0)
35
+ parser (3.0.1.1)
37
36
  ast (~> 2.4.1)
38
- pry (0.14.0)
37
+ pry (0.14.1)
39
38
  coderay (~> 1.1)
40
39
  method_source (~> 1.0)
41
40
  qonfig (0.25.0)
@@ -66,9 +65,9 @@ GEM
66
65
  rubocop-ast (>= 1.2.0, < 2.0)
67
66
  ruby-progressbar (~> 1.7)
68
67
  unicode-display_width (>= 1.4.0, < 3.0)
69
- rubocop-ast (1.4.1)
70
- parser (>= 2.7.1.5)
71
- rubocop-config-umbrellio (1.11.0.40)
68
+ rubocop-ast (1.7.0)
69
+ parser (>= 3.0.1.1)
70
+ rubocop-config-umbrellio (1.11.0.51)
72
71
  rubocop (= 1.11.0)
73
72
  rubocop-performance (= 1.10.0)
74
73
  rubocop-rails (= 2.9.1)
@@ -90,14 +89,14 @@ GEM
90
89
  rubocop-sequel (0.2.0)
91
90
  rubocop (~> 1.0)
92
91
  ruby-progressbar (1.11.0)
93
- sequel (5.43.0)
92
+ sequel (5.45.0)
94
93
  simplecov (0.21.2)
95
94
  docile (~> 1.1)
96
95
  simplecov-html (~> 0.11)
97
96
  simplecov_json_formatter (~> 0.1)
98
97
  simplecov-html (0.12.3)
99
98
  simplecov-lcov (0.8.0)
100
- simplecov_json_formatter (0.1.2)
99
+ simplecov_json_formatter (0.1.3)
101
100
  smart_engine (0.11.0)
102
101
  smart_initializer (0.5.0)
103
102
  qonfig (~> 0.24)
@@ -109,10 +108,9 @@ GEM
109
108
  thor (1.1.0)
110
109
  tzinfo (2.0.4)
111
110
  concurrent-ruby (~> 1.0)
112
- uber (0.1.0)
113
- umbrellio-sequel-plugins (0.4.0.164)
111
+ umbrellio-sequel-plugins (0.5.1.27)
114
112
  sequel
115
- symbiont-ruby (>= 0.6)
113
+ symbiont-ruby
116
114
  unicode-display_width (2.0.0)
117
115
  zeitwerk (2.4.2)
118
116
 
data/lib/resol.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "uber/builder"
4
3
  require "smart_core/initializer"
5
4
 
6
5
  require_relative "resol/version"
data/lib/resol/builder.rb CHANGED
@@ -1,18 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Resol
4
+ # Most of the code here is borrowed from Uber::Builder code
5
+ # See https://github.com/apotonick/uber/blob/master/lib/uber/builder.rb
4
6
  module Builder
5
7
  def self.included(base)
6
- base.include(Uber::Builder)
7
8
  base.extend(ClassMethods)
8
9
  end
9
10
 
11
+ class Builders < Array
12
+ def call(initial_klass, *args, **kwargs)
13
+ each do |block|
14
+ klass = block.call(initial_klass, *args, **kwargs) and return klass
15
+ end
16
+
17
+ initial_klass
18
+ end
19
+
20
+ def <<(proc)
21
+ wrapped = -> (ctx, *args, **kwargs) { ctx.instance_exec(*args, **kwargs, &proc) }
22
+ super(wrapped)
23
+ end
24
+ end
25
+
10
26
  module ClassMethods
11
- def build_klass(...)
27
+ def builders
28
+ @builders ||= Builders.new
29
+ end
30
+
31
+ def builds(proc = nil, &block)
32
+ builders << (proc || block)
33
+ end
34
+
35
+ def build_klass(*args, **kwargs)
12
36
  klass = self
13
37
 
14
38
  loop do
15
- new_klass = klass.build!(klass, ...)
39
+ new_klass = klass.builders.call(klass, *args, **kwargs)
16
40
  break if new_klass == klass
17
41
 
18
42
  klass = new_klass
data/lib/resol/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Resol
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksei Bespalov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-18 00:00:00.000000000 Z
11
+ date: 2021-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: smart_initializer
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.5'
27
- - !ruby/object:Gem::Dependency
28
- name: uber
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '0.1'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '0.1'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: bundler-audit
43
29
  requirement: !ruby/object:Gem::Requirement