smart_initializer 0.3.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -1
- data/CHANGELOG.md +26 -0
- data/Gemfile.lock +74 -64
- data/LICENSE.txt +1 -1
- data/README.md +30 -3
- data/bin/console +3 -3
- data/gemfiles/with_external_deps.gemfile.lock +71 -62
- data/gemfiles/without_external_deps.gemfile.lock +75 -66
- data/lib/smart_core/initializer.rb +0 -3
- data/lib/smart_core/initializer/attribute.rb +33 -2
- data/lib/smart_core/initializer/attribute/factory.rb +43 -3
- data/lib/smart_core/initializer/attribute/parameters.rb +30 -1
- data/lib/smart_core/initializer/constructor.rb +5 -5
- data/lib/smart_core/initializer/constructor/definer.rb +48 -4
- data/lib/smart_core/initializer/dsl.rb +17 -5
- data/lib/smart_core/initializer/errors.rb +4 -0
- data/lib/smart_core/initializer/functionality.rb +1 -0
- data/lib/smart_core/initializer/plugins.rb +1 -1
- data/lib/smart_core/initializer/plugins/abstract.rb +2 -2
- data/lib/smart_core/initializer/plugins/thy_types/thy_types/abstract_factory.rb +13 -2
- data/lib/smart_core/initializer/type_system/interop.rb +10 -1
- data/lib/smart_core/initializer/type_system/interop/abstract_factory.rb +12 -2
- data/lib/smart_core/initializer/type_system/smart_types/abstract_factory.rb +13 -2
- data/lib/smart_core/initializer/version.rb +2 -2
- data/smart_initializer.gemspec +7 -6
- metadata +32 -19
- data/.travis.yml +0 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fe42fb05f82247b924687f18a3eb129d7a49d0e9b071c801adc828c64ae4f93
|
4
|
+
data.tar.gz: 3dc7371d09e41172337c2bd98db4b06239f77c624cedcdbf8848503eba946de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a76205061e305e24474db7a08c045a9889ca8859d1658fa9df1fca20a94edea83574c5b62bb81daeefa21ba3c5ec70d9cb03b55b1f2910383bbde1735547677b
|
7
|
+
data.tar.gz: 3bafdce939b39dd8418dc1baeafecc199b6460b98e25e3eba5c5732f22c62d58df1c29383c31a668edd79782c8c29a18c9359f7ef080b0a4d6716b1dec457207
|
data/.rubocop.yml
CHANGED
@@ -5,15 +5,22 @@ inherit_gem:
|
|
5
5
|
- lib/rubocop.rspec.yml
|
6
6
|
|
7
7
|
AllCops:
|
8
|
-
TargetRubyVersion:
|
8
|
+
TargetRubyVersion: 3.0.0
|
9
|
+
NewCops: enable
|
9
10
|
Include:
|
10
11
|
- lib/**/*.rb
|
11
12
|
- spec/**/*.rb
|
12
13
|
- Gemfile
|
13
14
|
- Rakefile
|
14
15
|
- smart_initializer.gemspec
|
16
|
+
- gemfiles/*.gemfile
|
15
17
|
- bin/console
|
16
18
|
|
17
19
|
# NOTE: It is not suitable for infrastracture-level frameworks
|
18
20
|
Metrics/ParameterLists:
|
19
21
|
Enabled: false
|
22
|
+
|
23
|
+
# NOTE: It is ok to use empty blocks in specs (inside simple test cases)
|
24
|
+
Lint/EmptyBlock:
|
25
|
+
Exclude:
|
26
|
+
- spec/**/*.rb
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,32 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [0.6.0] - 2021-06-23
|
5
|
+
## Added
|
6
|
+
- Validation messages for incorrect attribute types;
|
7
|
+
|
8
|
+
## [0.5.0] - 2021-01-18
|
9
|
+
## Changed
|
10
|
+
- Updated `smart_types` dependency (`~> 0.4.0`) to guarantee **Ruby@3** compatibility;
|
11
|
+
- Updated development dependencies;
|
12
|
+
|
13
|
+
## [0.4.0] - 2021-01-18
|
14
|
+
### Added
|
15
|
+
- Support for **Ruby 3**;
|
16
|
+
|
17
|
+
### Changed
|
18
|
+
- Moved from `TravisCI` to nothing (todo: migrate to `GitHub Actions`).
|
19
|
+
Temporary: we must run test cases locally.
|
20
|
+
- Updated development dependencies;
|
21
|
+
|
22
|
+
## [0.3.2] - 2020-07-12
|
23
|
+
### Fixed
|
24
|
+
- Deeply inherited entities lose their `__initializer_settings__` entitiy;
|
25
|
+
|
26
|
+
## [0.3.1] - 2020-07-12
|
27
|
+
### Fixed
|
28
|
+
- Deeply inherited entities lose their class attribute definers;
|
29
|
+
|
4
30
|
## [0.3.0] - 2020-07-11
|
5
31
|
### Added
|
6
32
|
- `extend_initialization_flow` alias method for `SmartCore::Initializer.ext_init`;
|
data/Gemfile.lock
CHANGED
@@ -1,100 +1,110 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smart_initializer (0.
|
4
|
+
smart_initializer (0.6.0)
|
5
5
|
qonfig (~> 0.24)
|
6
|
-
smart_engine (~> 0.
|
7
|
-
smart_types (~> 0.
|
6
|
+
smart_engine (~> 0.11)
|
7
|
+
smart_types (~> 0.4)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (6.
|
12
|
+
activesupport (6.1.2)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
-
i18n (>=
|
15
|
-
minitest (
|
16
|
-
tzinfo (~>
|
17
|
-
zeitwerk (~> 2.
|
18
|
-
armitage-rubocop (
|
19
|
-
rubocop (=
|
20
|
-
rubocop-performance (= 1.
|
21
|
-
rubocop-rails (= 2.
|
14
|
+
i18n (>= 1.6, < 2)
|
15
|
+
minitest (>= 5.1)
|
16
|
+
tzinfo (~> 2.0)
|
17
|
+
zeitwerk (~> 2.3)
|
18
|
+
armitage-rubocop (1.8.1)
|
19
|
+
rubocop (= 1.8.1)
|
20
|
+
rubocop-performance (= 1.9.2)
|
21
|
+
rubocop-rails (= 2.9.1)
|
22
22
|
rubocop-rake (= 0.5.1)
|
23
|
-
rubocop-rspec (= 1.
|
24
|
-
ast (2.4.
|
25
|
-
|
23
|
+
rubocop-rspec (= 2.1.0)
|
24
|
+
ast (2.4.2)
|
25
|
+
coderay (1.1.3)
|
26
|
+
concurrent-ruby (1.1.8)
|
26
27
|
diff-lcs (1.4.4)
|
27
|
-
docile (1.3.
|
28
|
-
i18n (1.8.
|
28
|
+
docile (1.3.5)
|
29
|
+
i18n (1.8.8)
|
29
30
|
concurrent-ruby (~> 1.0)
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
method_source (1.0.0)
|
32
|
+
minitest (5.14.3)
|
33
|
+
parallel (1.20.1)
|
34
|
+
parser (3.0.0.0)
|
33
35
|
ast (~> 2.4.1)
|
34
|
-
|
36
|
+
pry (0.14.0)
|
37
|
+
coderay (~> 1.1)
|
38
|
+
method_source (~> 1.0)
|
39
|
+
qonfig (0.25.0)
|
35
40
|
rack (2.2.3)
|
36
41
|
rainbow (3.0.0)
|
37
|
-
rake (13.0.
|
38
|
-
regexp_parser (
|
42
|
+
rake (13.0.3)
|
43
|
+
regexp_parser (2.0.3)
|
39
44
|
rexml (3.2.4)
|
40
|
-
rspec (3.
|
41
|
-
rspec-core (~> 3.
|
42
|
-
rspec-expectations (~> 3.
|
43
|
-
rspec-mocks (~> 3.
|
44
|
-
rspec-core (3.
|
45
|
-
rspec-support (~> 3.
|
46
|
-
rspec-expectations (3.
|
45
|
+
rspec (3.10.0)
|
46
|
+
rspec-core (~> 3.10.0)
|
47
|
+
rspec-expectations (~> 3.10.0)
|
48
|
+
rspec-mocks (~> 3.10.0)
|
49
|
+
rspec-core (3.10.1)
|
50
|
+
rspec-support (~> 3.10.0)
|
51
|
+
rspec-expectations (3.10.1)
|
47
52
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-mocks (3.
|
53
|
+
rspec-support (~> 3.10.0)
|
54
|
+
rspec-mocks (3.10.2)
|
50
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-support (3.
|
53
|
-
rubocop (
|
56
|
+
rspec-support (~> 3.10.0)
|
57
|
+
rspec-support (3.10.2)
|
58
|
+
rubocop (1.8.1)
|
54
59
|
parallel (~> 1.10)
|
55
|
-
parser (>=
|
60
|
+
parser (>= 3.0.0.0)
|
56
61
|
rainbow (>= 2.2.2, < 4.0)
|
57
|
-
regexp_parser (>= 1.
|
62
|
+
regexp_parser (>= 1.8, < 3.0)
|
58
63
|
rexml
|
59
|
-
rubocop-ast (>=
|
64
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
60
65
|
ruby-progressbar (~> 1.7)
|
61
|
-
unicode-display_width (>= 1.4.0, <
|
62
|
-
rubocop-ast (
|
63
|
-
parser (>= 2.7.
|
64
|
-
rubocop-performance (1.
|
65
|
-
rubocop (>= 0.
|
66
|
-
|
66
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
67
|
+
rubocop-ast (1.4.1)
|
68
|
+
parser (>= 2.7.1.5)
|
69
|
+
rubocop-performance (1.9.2)
|
70
|
+
rubocop (>= 0.90.0, < 2.0)
|
71
|
+
rubocop-ast (>= 0.4.0)
|
72
|
+
rubocop-rails (2.9.1)
|
67
73
|
activesupport (>= 4.2.0)
|
68
74
|
rack (>= 1.1)
|
69
|
-
rubocop (>= 0.
|
75
|
+
rubocop (>= 0.90.0, < 2.0)
|
70
76
|
rubocop-rake (0.5.1)
|
71
77
|
rubocop
|
72
|
-
rubocop-rspec (1.
|
73
|
-
rubocop (
|
74
|
-
|
75
|
-
|
78
|
+
rubocop-rspec (2.1.0)
|
79
|
+
rubocop (~> 1.0)
|
80
|
+
rubocop-ast (>= 1.1.0)
|
81
|
+
ruby-progressbar (1.11.0)
|
82
|
+
simplecov (0.21.2)
|
76
83
|
docile (~> 1.1)
|
77
84
|
simplecov-html (~> 0.11)
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
85
|
+
simplecov_json_formatter (~> 0.1)
|
86
|
+
simplecov-html (0.12.3)
|
87
|
+
simplecov_json_formatter (0.1.2)
|
88
|
+
smart_engine (0.11.0)
|
89
|
+
smart_types (0.4.0)
|
90
|
+
smart_engine (~> 0.11)
|
91
|
+
tzinfo (2.0.4)
|
92
|
+
concurrent-ruby (~> 1.0)
|
93
|
+
unicode-display_width (2.0.0)
|
94
|
+
zeitwerk (2.4.2)
|
87
95
|
|
88
96
|
PLATFORMS
|
89
|
-
|
97
|
+
x86_64-darwin-19
|
98
|
+
x86_64-darwin-20
|
90
99
|
|
91
100
|
DEPENDENCIES
|
92
|
-
armitage-rubocop (~>
|
93
|
-
bundler (~> 2.
|
101
|
+
armitage-rubocop (~> 1.7)
|
102
|
+
bundler (~> 2.2)
|
103
|
+
pry (~> 0.14)
|
94
104
|
rake (~> 13.0)
|
95
|
-
rspec (~> 3.
|
96
|
-
simplecov (~> 0.
|
105
|
+
rspec (~> 3.10)
|
106
|
+
simplecov (~> 0.21)
|
97
107
|
smart_initializer!
|
98
108
|
|
99
109
|
BUNDLED WITH
|
100
|
-
2.
|
110
|
+
2.2.11
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# SmartCore::Initializer · [![Gem Version](https://badge.fury.io/rb/smart_initializer.svg)](https://badge.fury.io/rb/smart_initializer)
|
1
|
+
# SmartCore::Initializer · [![Gem Version](https://badge.fury.io/rb/smart_initializer.svg)](https://badge.fury.io/rb/smart_initializer)
|
2
2
|
|
3
3
|
A simple and convenient way to declare complex constructors with a support for various commonly used type systems.
|
4
4
|
(**in active development**).
|
@@ -30,7 +30,8 @@ require 'smart_core/initializer'
|
|
30
30
|
- [Initialization extension](#initialization-extension)
|
31
31
|
- [Plugins](#plugins)
|
32
32
|
- [thy-types](#plugin-thy-types)
|
33
|
-
- [
|
33
|
+
- [Roadmap](#roadmap)
|
34
|
+
- [Build](#build)
|
34
35
|
|
35
36
|
---
|
36
37
|
|
@@ -286,7 +287,19 @@ User.new(123, 'test', { admin: true, age: 22 })
|
|
286
287
|
|
287
288
|
---
|
288
289
|
|
289
|
-
##
|
290
|
+
## Roadmap
|
291
|
+
|
292
|
+
- (in development) Attribue Definition DSL
|
293
|
+
- Support for specifying the attribute accessor type (`read_only` parameter);
|
294
|
+
- Support for attribute aliasing (`as` parameter);
|
295
|
+
- Migrate from `TravisCI` to `GitHub Actions`;
|
296
|
+
- Extract `Type Interop` system to `smart_type-system`;
|
297
|
+
|
298
|
+
---
|
299
|
+
|
300
|
+
## Build
|
301
|
+
|
302
|
+
### Tests Running
|
290
303
|
|
291
304
|
- with plugin tests:
|
292
305
|
|
@@ -306,6 +319,20 @@ bin/rspec -n
|
|
306
319
|
bin/rspec -h
|
307
320
|
```
|
308
321
|
|
322
|
+
### Code Style Checking
|
323
|
+
|
324
|
+
- without auto-correction:
|
325
|
+
|
326
|
+
```shell
|
327
|
+
bundle exec rake rubocop
|
328
|
+
```
|
329
|
+
|
330
|
+
- with auto-correction:
|
331
|
+
|
332
|
+
```shell
|
333
|
+
bundle exec rake rubocop -A
|
334
|
+
```
|
335
|
+
|
309
336
|
---
|
310
337
|
|
311
338
|
## Contributing
|
data/bin/console
CHANGED
@@ -1,102 +1,111 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
smart_initializer (0.
|
4
|
+
smart_initializer (0.5.0)
|
5
5
|
qonfig (~> 0.24)
|
6
|
-
smart_engine (~> 0.
|
7
|
-
smart_types (~> 0.
|
6
|
+
smart_engine (~> 0.11)
|
7
|
+
smart_types (~> 0.4)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (6.
|
12
|
+
activesupport (6.1.1)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
-
i18n (>=
|
15
|
-
minitest (
|
16
|
-
tzinfo (~>
|
17
|
-
zeitwerk (~> 2.
|
18
|
-
armitage-rubocop (0.
|
19
|
-
rubocop (=
|
20
|
-
rubocop-performance (= 1.
|
21
|
-
rubocop-rails (= 2.
|
14
|
+
i18n (>= 1.6, < 2)
|
15
|
+
minitest (>= 5.1)
|
16
|
+
tzinfo (~> 2.0)
|
17
|
+
zeitwerk (~> 2.3)
|
18
|
+
armitage-rubocop (1.7.0.1)
|
19
|
+
rubocop (= 1.7.0)
|
20
|
+
rubocop-performance (= 1.9.1)
|
21
|
+
rubocop-rails (= 2.9.1)
|
22
22
|
rubocop-rake (= 0.5.1)
|
23
|
-
rubocop-rspec (= 1.
|
23
|
+
rubocop-rspec (= 2.1.0)
|
24
24
|
ast (2.4.1)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
coderay (1.1.3)
|
26
|
+
concurrent-ruby (1.1.7)
|
27
|
+
diff-lcs (1.4.4)
|
28
|
+
docile (1.3.5)
|
29
|
+
i18n (1.8.7)
|
29
30
|
concurrent-ruby (~> 1.0)
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
method_source (1.0.0)
|
32
|
+
minitest (5.14.3)
|
33
|
+
parallel (1.20.1)
|
34
|
+
parser (3.0.0.0)
|
33
35
|
ast (~> 2.4.1)
|
34
|
-
|
36
|
+
pry (0.13.1)
|
37
|
+
coderay (~> 1.1)
|
38
|
+
method_source (~> 1.0)
|
39
|
+
qonfig (0.25.0)
|
35
40
|
rack (2.2.3)
|
36
41
|
rainbow (3.0.0)
|
37
|
-
rake (13.0.
|
38
|
-
regexp_parser (
|
42
|
+
rake (13.0.3)
|
43
|
+
regexp_parser (2.0.3)
|
39
44
|
rexml (3.2.4)
|
40
|
-
rspec (3.
|
41
|
-
rspec-core (~> 3.
|
42
|
-
rspec-expectations (~> 3.
|
43
|
-
rspec-mocks (~> 3.
|
44
|
-
rspec-core (3.
|
45
|
-
rspec-support (~> 3.
|
46
|
-
rspec-expectations (3.
|
45
|
+
rspec (3.10.0)
|
46
|
+
rspec-core (~> 3.10.0)
|
47
|
+
rspec-expectations (~> 3.10.0)
|
48
|
+
rspec-mocks (~> 3.10.0)
|
49
|
+
rspec-core (3.10.1)
|
50
|
+
rspec-support (~> 3.10.0)
|
51
|
+
rspec-expectations (3.10.1)
|
47
52
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-mocks (3.
|
53
|
+
rspec-support (~> 3.10.0)
|
54
|
+
rspec-mocks (3.10.1)
|
50
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-support (3.
|
53
|
-
rubocop (
|
56
|
+
rspec-support (~> 3.10.0)
|
57
|
+
rspec-support (3.10.1)
|
58
|
+
rubocop (1.7.0)
|
54
59
|
parallel (~> 1.10)
|
55
|
-
parser (>= 2.7.1.
|
60
|
+
parser (>= 2.7.1.5)
|
56
61
|
rainbow (>= 2.2.2, < 4.0)
|
57
|
-
regexp_parser (>= 1.
|
62
|
+
regexp_parser (>= 1.8, < 3.0)
|
58
63
|
rexml
|
59
|
-
rubocop-ast (>=
|
64
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
60
65
|
ruby-progressbar (~> 1.7)
|
61
66
|
unicode-display_width (>= 1.4.0, < 2.0)
|
62
|
-
rubocop-ast (
|
63
|
-
parser (>= 2.7.
|
64
|
-
rubocop-performance (1.
|
65
|
-
rubocop (>= 0.
|
66
|
-
|
67
|
+
rubocop-ast (1.4.0)
|
68
|
+
parser (>= 2.7.1.5)
|
69
|
+
rubocop-performance (1.9.1)
|
70
|
+
rubocop (>= 0.90.0, < 2.0)
|
71
|
+
rubocop-ast (>= 0.4.0)
|
72
|
+
rubocop-rails (2.9.1)
|
67
73
|
activesupport (>= 4.2.0)
|
68
74
|
rack (>= 1.1)
|
69
|
-
rubocop (>= 0.
|
75
|
+
rubocop (>= 0.90.0, < 2.0)
|
70
76
|
rubocop-rake (0.5.1)
|
71
77
|
rubocop
|
72
|
-
rubocop-rspec (1.
|
73
|
-
rubocop (
|
74
|
-
|
75
|
-
|
78
|
+
rubocop-rspec (2.1.0)
|
79
|
+
rubocop (~> 1.0)
|
80
|
+
rubocop-ast (>= 1.1.0)
|
81
|
+
ruby-progressbar (1.11.0)
|
82
|
+
simplecov (0.21.2)
|
76
83
|
docile (~> 1.1)
|
77
84
|
simplecov-html (~> 0.11)
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
85
|
+
simplecov_json_formatter (~> 0.1)
|
86
|
+
simplecov-html (0.12.3)
|
87
|
+
simplecov_json_formatter (0.1.2)
|
88
|
+
smart_engine (0.11.0)
|
89
|
+
smart_types (0.4.0)
|
90
|
+
smart_engine (~> 0.11)
|
83
91
|
thy (0.1.4)
|
84
|
-
tzinfo (
|
85
|
-
|
92
|
+
tzinfo (2.0.4)
|
93
|
+
concurrent-ruby (~> 1.0)
|
86
94
|
unicode-display_width (1.7.0)
|
87
|
-
zeitwerk (2.
|
95
|
+
zeitwerk (2.4.2)
|
88
96
|
|
89
97
|
PLATFORMS
|
90
|
-
|
98
|
+
x86_64-darwin-20
|
91
99
|
|
92
100
|
DEPENDENCIES
|
93
|
-
armitage-rubocop (~>
|
94
|
-
bundler (~> 2.
|
101
|
+
armitage-rubocop (~> 1.7)
|
102
|
+
bundler (~> 2.2)
|
103
|
+
pry (~> 0.13)
|
95
104
|
rake (~> 13.0)
|
96
|
-
rspec (~> 3.
|
97
|
-
simplecov (~> 0.
|
105
|
+
rspec (~> 3.10)
|
106
|
+
simplecov (~> 0.21)
|
98
107
|
smart_initializer!
|
99
108
|
thy (~> 0.1.4)
|
100
109
|
|
101
110
|
BUNDLED WITH
|
102
|
-
2.
|
111
|
+
2.2.3
|