smart_initializer 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -2
- data/Gemfile.lock +49 -54
- data/gemfiles/with_external_deps.gemfile.lock +51 -55
- data/gemfiles/without_external_deps.gemfile.lock +51 -53
- data/lib/smart_core/initializer/attribute/list.rb +19 -20
- data/lib/smart_core/initializer/constructor/definer.rb +13 -19
- data/lib/smart_core/initializer/dsl.rb +4 -3
- data/lib/smart_core/initializer/extensions/list.rb +11 -14
- data/lib/smart_core/initializer/plugins/abstract.rb +3 -1
- data/lib/smart_core/initializer/plugins/registry.rb +13 -14
- data/lib/smart_core/initializer/plugins/registry_interface.rb +11 -19
- data/lib/smart_core/initializer/settings/auto_cast.rb +5 -11
- data/lib/smart_core/initializer/settings/base.rb +5 -13
- data/lib/smart_core/initializer/settings/strict_options.rb +5 -11
- data/lib/smart_core/initializer/settings/type_system.rb +7 -16
- data/lib/smart_core/initializer/type_system/interop/aliasing/alias_list.rb +18 -21
- data/lib/smart_core/initializer/type_system/registry.rb +22 -24
- data/lib/smart_core/initializer/type_system/registry_interface.rb +15 -22
- data/lib/smart_core/initializer/version.rb +2 -2
- data/smart_initializer.gemspec +5 -5
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f071c193e7dba7c0e30acf950159bc97f41933bbb7a6cb2e04838b1de474c0d7
|
4
|
+
data.tar.gz: 5867c7ffc8181767a85ad0d609ca3a1d9c6697e4eb0abaa3e9997341cc237165
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e964ae02c95f010da48499b508c8f5bd755aa0b44165fe173dcdd80385f4c1006fc469ebf5568303f5f47e58cb514c0f4a1e10b5062b2db5b953f57b3bda8549
|
7
|
+
data.tar.gz: 8907288d0ff34f3f76d6bf5291cce236413ef998a944966f90074e871126809b98c7ed16890ecf84a338da22096e108a6d40d84f640d602628ae97a5cc9656fd
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [0.
|
4
|
+
## [0.10.0] - 2022-10-04
|
5
|
+
### Changed
|
6
|
+
- `SmartCore::Engine::ReadWriteLock` is used instead `SmartCore::Engine::Lock` in order to decrease the count of RubyVM's context switching and useless Mutexes usage;
|
7
|
+
- reduced `KeyError`-exception flow use cases in some cases inside the framework internals (in order to reduce object allocations under the hood);
|
8
|
+
- bumped development dependencies;
|
9
|
+
- bumped core dependencies (in order to use `ReadWiteLock` (and actualize available inner-framework features);
|
5
10
|
|
11
|
+
## [0.9.1] - 2022-03-06
|
6
12
|
### Fixed
|
7
|
-
|
8
13
|
- `finalize` now accepts lambdas with arity `-2`. For example `->(a, *b) {}` or `:freeze.to_proc`
|
9
14
|
which in `Ruby >= 3` returns lambda with arity equal to `-2`.
|
10
15
|
|
data/Gemfile.lock
CHANGED
@@ -1,81 +1,80 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smart_initializer (0.
|
4
|
+
smart_initializer (0.10.0)
|
5
5
|
qonfig (~> 0.24)
|
6
|
-
smart_engine (~> 0.
|
7
|
-
smart_types (~> 0.
|
6
|
+
smart_engine (~> 0.16)
|
7
|
+
smart_types (~> 0.7)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (
|
12
|
+
activesupport (7.0.4)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
16
16
|
tzinfo (~> 2.0)
|
17
|
-
|
18
|
-
|
19
|
-
rubocop (= 1.
|
20
|
-
rubocop-
|
21
|
-
rubocop-rails (= 2.12.4)
|
17
|
+
armitage-rubocop (1.30.1.1)
|
18
|
+
rubocop (= 1.30.1)
|
19
|
+
rubocop-performance (= 1.14.2)
|
20
|
+
rubocop-rails (= 2.15.0)
|
22
21
|
rubocop-rake (= 0.6.0)
|
23
|
-
rubocop-rspec (= 2.
|
22
|
+
rubocop-rspec (= 2.11.1)
|
24
23
|
ast (2.4.2)
|
25
24
|
coderay (1.1.3)
|
26
|
-
concurrent-ruby (1.1.
|
27
|
-
diff-lcs (1.
|
25
|
+
concurrent-ruby (1.1.10)
|
26
|
+
diff-lcs (1.5.0)
|
28
27
|
docile (1.4.0)
|
29
|
-
i18n (1.
|
28
|
+
i18n (1.12.0)
|
30
29
|
concurrent-ruby (~> 1.0)
|
31
30
|
method_source (1.0.0)
|
32
|
-
minitest (5.
|
33
|
-
parallel (1.
|
34
|
-
parser (3.
|
31
|
+
minitest (5.16.3)
|
32
|
+
parallel (1.22.1)
|
33
|
+
parser (3.1.2.1)
|
35
34
|
ast (~> 2.4.1)
|
36
35
|
pry (0.14.1)
|
37
36
|
coderay (~> 1.1)
|
38
37
|
method_source (~> 1.0)
|
39
|
-
qonfig (0.
|
40
|
-
rack (
|
41
|
-
rainbow (3.
|
38
|
+
qonfig (0.28.0)
|
39
|
+
rack (3.0.0)
|
40
|
+
rainbow (3.1.1)
|
42
41
|
rake (13.0.6)
|
43
|
-
regexp_parser (2.
|
42
|
+
regexp_parser (2.6.0)
|
44
43
|
rexml (3.2.5)
|
45
|
-
rspec (3.
|
46
|
-
rspec-core (~> 3.
|
47
|
-
rspec-expectations (~> 3.
|
48
|
-
rspec-mocks (~> 3.
|
49
|
-
rspec-core (3.
|
50
|
-
rspec-support (~> 3.
|
51
|
-
rspec-expectations (3.
|
44
|
+
rspec (3.11.0)
|
45
|
+
rspec-core (~> 3.11.0)
|
46
|
+
rspec-expectations (~> 3.11.0)
|
47
|
+
rspec-mocks (~> 3.11.0)
|
48
|
+
rspec-core (3.11.0)
|
49
|
+
rspec-support (~> 3.11.0)
|
50
|
+
rspec-expectations (3.11.1)
|
52
51
|
diff-lcs (>= 1.2.0, < 2.0)
|
53
|
-
rspec-support (~> 3.
|
54
|
-
rspec-mocks (3.
|
52
|
+
rspec-support (~> 3.11.0)
|
53
|
+
rspec-mocks (3.11.1)
|
55
54
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-support (3.
|
58
|
-
rubocop (1.
|
55
|
+
rspec-support (~> 3.11.0)
|
56
|
+
rspec-support (3.11.1)
|
57
|
+
rubocop (1.30.1)
|
59
58
|
parallel (~> 1.10)
|
60
|
-
parser (>= 3.
|
59
|
+
parser (>= 3.1.0.0)
|
61
60
|
rainbow (>= 2.2.2, < 4.0)
|
62
61
|
regexp_parser (>= 1.8, < 3.0)
|
63
|
-
rexml
|
64
|
-
rubocop-ast (>= 1.
|
62
|
+
rexml (>= 3.2.5, < 4.0)
|
63
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
65
64
|
ruby-progressbar (~> 1.7)
|
66
65
|
unicode-display_width (>= 1.4.0, < 3.0)
|
67
|
-
rubocop-ast (1.
|
68
|
-
parser (>= 3.
|
69
|
-
rubocop-performance (1.
|
66
|
+
rubocop-ast (1.21.0)
|
67
|
+
parser (>= 3.1.1.0)
|
68
|
+
rubocop-performance (1.14.2)
|
70
69
|
rubocop (>= 1.7.0, < 2.0)
|
71
70
|
rubocop-ast (>= 0.4.0)
|
72
|
-
rubocop-rails (2.
|
71
|
+
rubocop-rails (2.15.0)
|
73
72
|
activesupport (>= 4.2.0)
|
74
73
|
rack (>= 1.1)
|
75
74
|
rubocop (>= 1.7.0, < 2.0)
|
76
75
|
rubocop-rake (0.6.0)
|
77
76
|
rubocop (~> 1.0)
|
78
|
-
rubocop-rspec (2.
|
77
|
+
rubocop-rspec (2.11.1)
|
79
78
|
rubocop (~> 1.19)
|
80
79
|
ruby-progressbar (1.11.0)
|
81
80
|
simplecov (0.21.2)
|
@@ -83,29 +82,25 @@ GEM
|
|
83
82
|
simplecov-html (~> 0.11)
|
84
83
|
simplecov_json_formatter (~> 0.1)
|
85
84
|
simplecov-html (0.12.3)
|
86
|
-
simplecov_json_formatter (0.1.
|
87
|
-
smart_engine (0.
|
88
|
-
smart_types (0.7.
|
85
|
+
simplecov_json_formatter (0.1.4)
|
86
|
+
smart_engine (0.16.0)
|
87
|
+
smart_types (0.7.1)
|
89
88
|
smart_engine (~> 0.11)
|
90
|
-
tzinfo (2.0.
|
89
|
+
tzinfo (2.0.5)
|
91
90
|
concurrent-ruby (~> 1.0)
|
92
|
-
unicode-display_width (2.
|
93
|
-
zeitwerk (2.5.1)
|
91
|
+
unicode-display_width (2.3.0)
|
94
92
|
|
95
93
|
PLATFORMS
|
96
|
-
|
97
|
-
x86_64-darwin-20
|
98
|
-
x86_64-darwin-21
|
99
|
-
x86_64-linux
|
94
|
+
arm64-darwin-21
|
100
95
|
|
101
96
|
DEPENDENCIES
|
102
|
-
armitage-rubocop (~> 1.
|
103
|
-
bundler (~> 2.
|
97
|
+
armitage-rubocop (~> 1.30)
|
98
|
+
bundler (~> 2.3)
|
104
99
|
pry (~> 0.14)
|
105
100
|
rake (~> 13.0)
|
106
|
-
rspec (~> 3.
|
101
|
+
rspec (~> 3.11)
|
107
102
|
simplecov (~> 0.21)
|
108
103
|
smart_initializer!
|
109
104
|
|
110
105
|
BUNDLED WITH
|
111
|
-
2.
|
106
|
+
2.3.17
|
@@ -1,81 +1,80 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
smart_initializer (0.
|
4
|
+
smart_initializer (0.10.0)
|
5
5
|
qonfig (~> 0.24)
|
6
|
-
smart_engine (~> 0.
|
7
|
-
smart_types (~> 0.
|
6
|
+
smart_engine (~> 0.16)
|
7
|
+
smart_types (~> 0.7)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (
|
12
|
+
activesupport (7.0.4)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
16
16
|
tzinfo (~> 2.0)
|
17
|
-
|
18
|
-
|
19
|
-
rubocop (= 1.
|
20
|
-
rubocop-
|
21
|
-
rubocop-rails (= 2.12.4)
|
17
|
+
armitage-rubocop (1.30.1.1)
|
18
|
+
rubocop (= 1.30.1)
|
19
|
+
rubocop-performance (= 1.14.2)
|
20
|
+
rubocop-rails (= 2.15.0)
|
22
21
|
rubocop-rake (= 0.6.0)
|
23
|
-
rubocop-rspec (= 2.
|
22
|
+
rubocop-rspec (= 2.11.1)
|
24
23
|
ast (2.4.2)
|
25
24
|
coderay (1.1.3)
|
26
|
-
concurrent-ruby (1.1.
|
27
|
-
diff-lcs (1.
|
28
|
-
docile (1.
|
29
|
-
i18n (1.
|
25
|
+
concurrent-ruby (1.1.10)
|
26
|
+
diff-lcs (1.5.0)
|
27
|
+
docile (1.4.0)
|
28
|
+
i18n (1.12.0)
|
30
29
|
concurrent-ruby (~> 1.0)
|
31
30
|
method_source (1.0.0)
|
32
|
-
minitest (5.
|
33
|
-
parallel (1.
|
34
|
-
parser (3.
|
31
|
+
minitest (5.16.3)
|
32
|
+
parallel (1.22.1)
|
33
|
+
parser (3.1.2.1)
|
35
34
|
ast (~> 2.4.1)
|
36
35
|
pry (0.14.1)
|
37
36
|
coderay (~> 1.1)
|
38
37
|
method_source (~> 1.0)
|
39
|
-
qonfig (0.
|
40
|
-
rack (
|
41
|
-
rainbow (3.
|
42
|
-
rake (13.0.
|
43
|
-
regexp_parser (2.
|
38
|
+
qonfig (0.28.0)
|
39
|
+
rack (3.0.0)
|
40
|
+
rainbow (3.1.1)
|
41
|
+
rake (13.0.6)
|
42
|
+
regexp_parser (2.6.0)
|
44
43
|
rexml (3.2.5)
|
45
|
-
rspec (3.
|
46
|
-
rspec-core (~> 3.
|
47
|
-
rspec-expectations (~> 3.
|
48
|
-
rspec-mocks (~> 3.
|
49
|
-
rspec-core (3.
|
50
|
-
rspec-support (~> 3.
|
51
|
-
rspec-expectations (3.
|
44
|
+
rspec (3.11.0)
|
45
|
+
rspec-core (~> 3.11.0)
|
46
|
+
rspec-expectations (~> 3.11.0)
|
47
|
+
rspec-mocks (~> 3.11.0)
|
48
|
+
rspec-core (3.11.0)
|
49
|
+
rspec-support (~> 3.11.0)
|
50
|
+
rspec-expectations (3.11.1)
|
52
51
|
diff-lcs (>= 1.2.0, < 2.0)
|
53
|
-
rspec-support (~> 3.
|
54
|
-
rspec-mocks (3.
|
52
|
+
rspec-support (~> 3.11.0)
|
53
|
+
rspec-mocks (3.11.1)
|
55
54
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-support (3.
|
58
|
-
rubocop (1.
|
55
|
+
rspec-support (~> 3.11.0)
|
56
|
+
rspec-support (3.11.1)
|
57
|
+
rubocop (1.30.1)
|
59
58
|
parallel (~> 1.10)
|
60
|
-
parser (>= 3.
|
59
|
+
parser (>= 3.1.0.0)
|
61
60
|
rainbow (>= 2.2.2, < 4.0)
|
62
61
|
regexp_parser (>= 1.8, < 3.0)
|
63
|
-
rexml
|
64
|
-
rubocop-ast (>= 1.
|
62
|
+
rexml (>= 3.2.5, < 4.0)
|
63
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
65
64
|
ruby-progressbar (~> 1.7)
|
66
65
|
unicode-display_width (>= 1.4.0, < 3.0)
|
67
|
-
rubocop-ast (1.
|
68
|
-
parser (>= 3.
|
69
|
-
rubocop-performance (1.
|
66
|
+
rubocop-ast (1.21.0)
|
67
|
+
parser (>= 3.1.1.0)
|
68
|
+
rubocop-performance (1.14.2)
|
70
69
|
rubocop (>= 1.7.0, < 2.0)
|
71
70
|
rubocop-ast (>= 0.4.0)
|
72
|
-
rubocop-rails (2.
|
71
|
+
rubocop-rails (2.15.0)
|
73
72
|
activesupport (>= 4.2.0)
|
74
73
|
rack (>= 1.1)
|
75
74
|
rubocop (>= 1.7.0, < 2.0)
|
76
75
|
rubocop-rake (0.6.0)
|
77
76
|
rubocop (~> 1.0)
|
78
|
-
rubocop-rspec (2.
|
77
|
+
rubocop-rspec (2.11.1)
|
79
78
|
rubocop (~> 1.19)
|
80
79
|
ruby-progressbar (1.11.0)
|
81
80
|
simplecov (0.21.2)
|
@@ -83,30 +82,27 @@ GEM
|
|
83
82
|
simplecov-html (~> 0.11)
|
84
83
|
simplecov_json_formatter (~> 0.1)
|
85
84
|
simplecov-html (0.12.3)
|
86
|
-
simplecov_json_formatter (0.1.
|
87
|
-
smart_engine (0.
|
88
|
-
smart_types (0.7.
|
85
|
+
simplecov_json_formatter (0.1.4)
|
86
|
+
smart_engine (0.16.0)
|
87
|
+
smart_types (0.7.1)
|
89
88
|
smart_engine (~> 0.11)
|
90
89
|
thy (0.1.4)
|
91
|
-
tzinfo (2.0.
|
90
|
+
tzinfo (2.0.5)
|
92
91
|
concurrent-ruby (~> 1.0)
|
93
|
-
unicode-display_width (2.
|
94
|
-
zeitwerk (2.5.1)
|
92
|
+
unicode-display_width (2.3.0)
|
95
93
|
|
96
94
|
PLATFORMS
|
97
|
-
|
98
|
-
x86_64-darwin-21
|
99
|
-
x86_64-linux
|
95
|
+
arm64-darwin-21
|
100
96
|
|
101
97
|
DEPENDENCIES
|
102
|
-
armitage-rubocop (~> 1.
|
103
|
-
bundler (~> 2.
|
98
|
+
armitage-rubocop (~> 1.30)
|
99
|
+
bundler (~> 2.3)
|
104
100
|
pry (~> 0.14)
|
105
101
|
rake (~> 13.0)
|
106
|
-
rspec (~> 3.
|
102
|
+
rspec (~> 3.11)
|
107
103
|
simplecov (~> 0.21)
|
108
104
|
smart_initializer!
|
109
105
|
thy (~> 0.1.4)
|
110
106
|
|
111
107
|
BUNDLED WITH
|
112
|
-
2.
|
108
|
+
2.3.17
|
@@ -1,80 +1,80 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
smart_initializer (0.
|
4
|
+
smart_initializer (0.10.0)
|
5
5
|
qonfig (~> 0.24)
|
6
|
-
smart_engine (~> 0.
|
7
|
-
smart_types (~> 0.
|
6
|
+
smart_engine (~> 0.16)
|
7
|
+
smart_types (~> 0.7)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (7.0.
|
12
|
+
activesupport (7.0.4)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
16
16
|
tzinfo (~> 2.0)
|
17
|
-
armitage-rubocop (1.
|
18
|
-
rubocop (= 1.
|
19
|
-
rubocop-performance (= 1.
|
20
|
-
rubocop-rails (= 2.
|
17
|
+
armitage-rubocop (1.30.1.1)
|
18
|
+
rubocop (= 1.30.1)
|
19
|
+
rubocop-performance (= 1.14.2)
|
20
|
+
rubocop-rails (= 2.15.0)
|
21
21
|
rubocop-rake (= 0.6.0)
|
22
|
-
rubocop-rspec (= 2.
|
22
|
+
rubocop-rspec (= 2.11.1)
|
23
23
|
ast (2.4.2)
|
24
24
|
coderay (1.1.3)
|
25
|
-
concurrent-ruby (1.1.
|
26
|
-
diff-lcs (1.
|
27
|
-
docile (1.
|
28
|
-
i18n (1.
|
25
|
+
concurrent-ruby (1.1.10)
|
26
|
+
diff-lcs (1.5.0)
|
27
|
+
docile (1.4.0)
|
28
|
+
i18n (1.12.0)
|
29
29
|
concurrent-ruby (~> 1.0)
|
30
30
|
method_source (1.0.0)
|
31
|
-
minitest (5.
|
32
|
-
parallel (1.
|
33
|
-
parser (3.
|
31
|
+
minitest (5.16.3)
|
32
|
+
parallel (1.22.1)
|
33
|
+
parser (3.1.2.1)
|
34
34
|
ast (~> 2.4.1)
|
35
35
|
pry (0.14.1)
|
36
36
|
coderay (~> 1.1)
|
37
37
|
method_source (~> 1.0)
|
38
|
-
qonfig (0.
|
39
|
-
rack (
|
40
|
-
rainbow (3.
|
41
|
-
rake (13.0.
|
42
|
-
regexp_parser (2.
|
38
|
+
qonfig (0.28.0)
|
39
|
+
rack (3.0.0)
|
40
|
+
rainbow (3.1.1)
|
41
|
+
rake (13.0.6)
|
42
|
+
regexp_parser (2.6.0)
|
43
43
|
rexml (3.2.5)
|
44
|
-
rspec (3.
|
45
|
-
rspec-core (~> 3.
|
46
|
-
rspec-expectations (~> 3.
|
47
|
-
rspec-mocks (~> 3.
|
48
|
-
rspec-core (3.
|
49
|
-
rspec-support (~> 3.
|
50
|
-
rspec-expectations (3.
|
44
|
+
rspec (3.11.0)
|
45
|
+
rspec-core (~> 3.11.0)
|
46
|
+
rspec-expectations (~> 3.11.0)
|
47
|
+
rspec-mocks (~> 3.11.0)
|
48
|
+
rspec-core (3.11.0)
|
49
|
+
rspec-support (~> 3.11.0)
|
50
|
+
rspec-expectations (3.11.1)
|
51
51
|
diff-lcs (>= 1.2.0, < 2.0)
|
52
|
-
rspec-support (~> 3.
|
53
|
-
rspec-mocks (3.
|
52
|
+
rspec-support (~> 3.11.0)
|
53
|
+
rspec-mocks (3.11.1)
|
54
54
|
diff-lcs (>= 1.2.0, < 2.0)
|
55
|
-
rspec-support (~> 3.
|
56
|
-
rspec-support (3.
|
57
|
-
rubocop (1.
|
55
|
+
rspec-support (~> 3.11.0)
|
56
|
+
rspec-support (3.11.1)
|
57
|
+
rubocop (1.30.1)
|
58
58
|
parallel (~> 1.10)
|
59
|
-
parser (>= 3.
|
59
|
+
parser (>= 3.1.0.0)
|
60
60
|
rainbow (>= 2.2.2, < 4.0)
|
61
61
|
regexp_parser (>= 1.8, < 3.0)
|
62
|
-
rexml
|
63
|
-
rubocop-ast (>= 1.
|
62
|
+
rexml (>= 3.2.5, < 4.0)
|
63
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
64
64
|
ruby-progressbar (~> 1.7)
|
65
65
|
unicode-display_width (>= 1.4.0, < 3.0)
|
66
|
-
rubocop-ast (1.
|
67
|
-
parser (>= 3.
|
68
|
-
rubocop-performance (1.
|
66
|
+
rubocop-ast (1.21.0)
|
67
|
+
parser (>= 3.1.1.0)
|
68
|
+
rubocop-performance (1.14.2)
|
69
69
|
rubocop (>= 1.7.0, < 2.0)
|
70
70
|
rubocop-ast (>= 0.4.0)
|
71
|
-
rubocop-rails (2.
|
71
|
+
rubocop-rails (2.15.0)
|
72
72
|
activesupport (>= 4.2.0)
|
73
73
|
rack (>= 1.1)
|
74
74
|
rubocop (>= 1.7.0, < 2.0)
|
75
75
|
rubocop-rake (0.6.0)
|
76
76
|
rubocop (~> 1.0)
|
77
|
-
rubocop-rspec (2.
|
77
|
+
rubocop-rspec (2.11.1)
|
78
78
|
rubocop (~> 1.19)
|
79
79
|
ruby-progressbar (1.11.0)
|
80
80
|
simplecov (0.21.2)
|
@@ -82,27 +82,25 @@ GEM
|
|
82
82
|
simplecov-html (~> 0.11)
|
83
83
|
simplecov_json_formatter (~> 0.1)
|
84
84
|
simplecov-html (0.12.3)
|
85
|
-
simplecov_json_formatter (0.1.
|
86
|
-
smart_engine (0.
|
87
|
-
smart_types (0.7.
|
85
|
+
simplecov_json_formatter (0.1.4)
|
86
|
+
smart_engine (0.16.0)
|
87
|
+
smart_types (0.7.1)
|
88
88
|
smart_engine (~> 0.11)
|
89
|
-
tzinfo (2.0.
|
89
|
+
tzinfo (2.0.5)
|
90
90
|
concurrent-ruby (~> 1.0)
|
91
|
-
unicode-display_width (2.
|
91
|
+
unicode-display_width (2.3.0)
|
92
92
|
|
93
93
|
PLATFORMS
|
94
|
-
|
95
|
-
x86_64-darwin-21
|
96
|
-
x86_64-linux
|
94
|
+
arm64-darwin-21
|
97
95
|
|
98
96
|
DEPENDENCIES
|
99
|
-
armitage-rubocop (~> 1.
|
100
|
-
bundler (~> 2.
|
97
|
+
armitage-rubocop (~> 1.30)
|
98
|
+
bundler (~> 2.3)
|
101
99
|
pry (~> 0.14)
|
102
100
|
rake (~> 13.0)
|
103
|
-
rspec (~> 3.
|
101
|
+
rspec (~> 3.11)
|
104
102
|
simplecov (~> 0.21)
|
105
103
|
smart_initializer!
|
106
104
|
|
107
105
|
BUNDLED WITH
|
108
|
-
2.
|
106
|
+
2.3.17
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
# @api private
|
4
4
|
# @since 0.1.0
|
5
|
+
# @version 0.10.0
|
5
6
|
class SmartCore::Initializer::Attribute::List
|
6
7
|
# @since 0.1.0
|
7
8
|
include Enumerable
|
@@ -10,9 +11,10 @@ class SmartCore::Initializer::Attribute::List
|
|
10
11
|
#
|
11
12
|
# @api private
|
12
13
|
# @since 0.1.0
|
14
|
+
# @version 0.10.0
|
13
15
|
def initialize
|
14
16
|
@attributes = {}
|
15
|
-
@lock = SmartCore::Engine::
|
17
|
+
@lock = SmartCore::Engine::ReadWriteLock.new
|
16
18
|
end
|
17
19
|
|
18
20
|
# @param attribute_name [Symbol]
|
@@ -22,15 +24,16 @@ class SmartCore::Initializer::Attribute::List
|
|
22
24
|
#
|
23
25
|
# @api private
|
24
26
|
# @since 0.8.0
|
27
|
+
# @version 0.10.0
|
25
28
|
def fetch(attribute_name)
|
26
|
-
|
27
|
-
attributes.fetch(attribute_name)
|
28
|
-
rescue ::KeyError
|
29
|
+
@lock.read_sync do
|
29
30
|
raise(
|
30
31
|
::SmartCore::Initializer::UndefinedAttributeError,
|
31
32
|
"Attribute with `#{attribute_name}` name is not defined in your constructor. " \
|
32
33
|
"Please, check your attribute definitions inside your class."
|
33
|
-
)
|
34
|
+
) unless attributes.key?(attribute_name)
|
35
|
+
|
36
|
+
attributes[attribute_name]
|
34
37
|
end
|
35
38
|
end
|
36
39
|
alias_method :[], :fetch
|
@@ -40,8 +43,9 @@ class SmartCore::Initializer::Attribute::List
|
|
40
43
|
#
|
41
44
|
# @api private
|
42
45
|
# @since 0.1.0
|
46
|
+
# @version 0.10.0
|
43
47
|
def add(attribute)
|
44
|
-
|
48
|
+
@lock.write_sync { attributes[attribute.name] = attribute }
|
45
49
|
end
|
46
50
|
alias_method :<<, :add
|
47
51
|
|
@@ -50,8 +54,9 @@ class SmartCore::Initializer::Attribute::List
|
|
50
54
|
#
|
51
55
|
# @api private
|
52
56
|
# @since 0.1.0
|
57
|
+
# @version 0.10.0
|
53
58
|
def concat(list)
|
54
|
-
|
59
|
+
@lock.write_sync do
|
55
60
|
list.each { |attribute| add(attribute.dup) }
|
56
61
|
end
|
57
62
|
end
|
@@ -62,7 +67,7 @@ class SmartCore::Initializer::Attribute::List
|
|
62
67
|
# @api private
|
63
68
|
# @since 0.1.0
|
64
69
|
def include?(attribute)
|
65
|
-
|
70
|
+
@lock.read_sync { attributes.key?(attribute.name) }
|
66
71
|
end
|
67
72
|
|
68
73
|
# @param block [Block]
|
@@ -70,8 +75,9 @@ class SmartCore::Initializer::Attribute::List
|
|
70
75
|
#
|
71
76
|
# @api private
|
72
77
|
# @since 0.1.0
|
78
|
+
# @version 0.10.0
|
73
79
|
def each(&block)
|
74
|
-
|
80
|
+
@lock.read_sync do
|
75
81
|
block_given? ? attributes.values.each(&block) : attributes.values.each
|
76
82
|
end
|
77
83
|
end
|
@@ -80,8 +86,9 @@ class SmartCore::Initializer::Attribute::List
|
|
80
86
|
#
|
81
87
|
# @api private
|
82
88
|
# @since 0.1.0
|
89
|
+
# @version 0.10.0
|
83
90
|
def size
|
84
|
-
|
91
|
+
@lock.read_sync { attributes.size }
|
85
92
|
end
|
86
93
|
|
87
94
|
# @param block [Block]
|
@@ -89,8 +96,9 @@ class SmartCore::Initializer::Attribute::List
|
|
89
96
|
#
|
90
97
|
# @api private
|
91
98
|
# @since 0.1.0
|
99
|
+
# @version 0.10.0
|
92
100
|
def count(&block)
|
93
|
-
|
101
|
+
@lock.read_sync { attributes.values.count(&block) }
|
94
102
|
end
|
95
103
|
|
96
104
|
private
|
@@ -100,13 +108,4 @@ class SmartCore::Initializer::Attribute::List
|
|
100
108
|
# @api private
|
101
109
|
# @since 0.1.0
|
102
110
|
attr_reader :attributes
|
103
|
-
|
104
|
-
# @param block [Block]
|
105
|
-
# @return [Any]
|
106
|
-
#
|
107
|
-
# @api private
|
108
|
-
# @since 0.1.0
|
109
|
-
def thread_safe(&block)
|
110
|
-
@lock.synchronize(&block)
|
111
|
-
end
|
112
111
|
end
|