smart_initializer 0.3.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5134f8c4bce2fc85b936310f04e67bf2d065205a29a34a53435eca06efba17f6
4
- data.tar.gz: b4de1f15734ca61d124c944aeaca4f87fb6e5c1d5e4f8d92a3c7b63516ce708e
3
+ metadata.gz: 7fe42fb05f82247b924687f18a3eb129d7a49d0e9b071c801adc828c64ae4f93
4
+ data.tar.gz: 3dc7371d09e41172337c2bd98db4b06239f77c624cedcdbf8848503eba946de2
5
5
  SHA512:
6
- metadata.gz: 86e1523cec71037f80aa99a6e36a5ffe06ca0da34d90f97e836dafdcd096cadceaebcb147499a636d1ce0f6868b0781e22ba21e0d589fb127cdfe41ff4882940
7
- data.tar.gz: 4b9e5b9f6e3742cfa38fb969a7b3d0d2a5e85d49cd94a7f498d6302cdb1ac3910642772f5c9246a51fb4bf1ab4231af3c8a2a8328c4b343471a4e2563b3e9cd6
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: 2.7.1
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.2.0)
4
+ smart_initializer (0.6.0)
5
5
  qonfig (~> 0.24)
6
- smart_engine (~> 0.7)
7
- smart_types (~> 0.1.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.0.3.2)
12
+ activesupport (6.1.2)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
- i18n (>= 0.7, < 2)
15
- minitest (~> 5.1)
16
- tzinfo (~> 1.1)
17
- zeitwerk (~> 2.2, >= 2.2.2)
18
- armitage-rubocop (0.87.1.2)
19
- rubocop (= 0.87.1)
20
- rubocop-performance (= 1.7.0)
21
- rubocop-rails (= 2.6.0)
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.42.0)
24
- ast (2.4.1)
25
- concurrent-ruby (1.1.6)
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.2)
28
- i18n (1.8.3)
28
+ docile (1.3.5)
29
+ i18n (1.8.8)
29
30
  concurrent-ruby (~> 1.0)
30
- minitest (5.14.1)
31
- parallel (1.19.2)
32
- parser (2.7.1.4)
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
- qonfig (0.24.1)
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.1)
38
- regexp_parser (1.7.1)
42
+ rake (13.0.3)
43
+ regexp_parser (2.0.3)
39
44
  rexml (3.2.4)
40
- rspec (3.9.0)
41
- rspec-core (~> 3.9.0)
42
- rspec-expectations (~> 3.9.0)
43
- rspec-mocks (~> 3.9.0)
44
- rspec-core (3.9.2)
45
- rspec-support (~> 3.9.3)
46
- rspec-expectations (3.9.2)
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.9.0)
49
- rspec-mocks (3.9.1)
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.9.0)
52
- rspec-support (3.9.3)
53
- rubocop (0.87.1)
56
+ rspec-support (~> 3.10.0)
57
+ rspec-support (3.10.2)
58
+ rubocop (1.8.1)
54
59
  parallel (~> 1.10)
55
- parser (>= 2.7.1.1)
60
+ parser (>= 3.0.0.0)
56
61
  rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 1.7)
62
+ regexp_parser (>= 1.8, < 3.0)
58
63
  rexml
59
- rubocop-ast (>= 0.1.0, < 1.0)
64
+ rubocop-ast (>= 1.2.0, < 2.0)
60
65
  ruby-progressbar (~> 1.7)
61
- unicode-display_width (>= 1.4.0, < 2.0)
62
- rubocop-ast (0.1.0)
63
- parser (>= 2.7.0.1)
64
- rubocop-performance (1.7.0)
65
- rubocop (>= 0.82.0)
66
- rubocop-rails (2.6.0)
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.82.0)
75
+ rubocop (>= 0.90.0, < 2.0)
70
76
  rubocop-rake (0.5.1)
71
77
  rubocop
72
- rubocop-rspec (1.42.0)
73
- rubocop (>= 0.87.0)
74
- ruby-progressbar (1.10.1)
75
- simplecov (0.18.5)
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
- simplecov-html (0.12.2)
79
- smart_engine (0.7.0)
80
- smart_types (0.1.0)
81
- smart_engine (~> 0.6)
82
- thread_safe (0.3.6)
83
- tzinfo (1.2.7)
84
- thread_safe (~> 0.1)
85
- unicode-display_width (1.7.0)
86
- zeitwerk (2.3.1)
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
- ruby
97
+ x86_64-darwin-19
98
+ x86_64-darwin-20
90
99
 
91
100
  DEPENDENCIES
92
- armitage-rubocop (~> 0.87)
93
- bundler (~> 2.1)
101
+ armitage-rubocop (~> 1.7)
102
+ bundler (~> 2.2)
103
+ pry (~> 0.14)
94
104
  rake (~> 13.0)
95
- rspec (~> 3.9)
96
- simplecov (~> 0.18)
105
+ rspec (~> 3.10)
106
+ simplecov (~> 0.21)
97
107
  smart_initializer!
98
108
 
99
109
  BUNDLED WITH
100
- 2.1.4
110
+ 2.2.11
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 Rustam Ibragimov
3
+ Copyright (c) 2020-2021 Rustam Ibragimov
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # SmartCore::Initializer &middot; [![Gem Version](https://badge.fury.io/rb/smart_initializer.svg)](https://badge.fury.io/rb/smart_initializer) [![Build Status](https://travis-ci.org/smart-rb/smart_initializer.svg?branch=master)](https://travis-ci.org/smart-rb/smart_initializer)
1
+ # SmartCore::Initializer &middot; [![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
- - [How to run tests](#how-to-run-tests)
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
- ## How to run tests
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
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'bundler/setup'
5
- require 'smart_core/initializer'
5
+ require 'smart_core'
6
6
 
7
- require 'irb'
8
- IRB.start(__FILE__)
7
+ require 'pry'
8
+ Pry.start
@@ -1,102 +1,111 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- smart_initializer (0.2.0)
4
+ smart_initializer (0.5.0)
5
5
  qonfig (~> 0.24)
6
- smart_engine (~> 0.7)
7
- smart_types (~> 0.1.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.0.3.2)
12
+ activesupport (6.1.1)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
- i18n (>= 0.7, < 2)
15
- minitest (~> 5.1)
16
- tzinfo (~> 1.1)
17
- zeitwerk (~> 2.2, >= 2.2.2)
18
- armitage-rubocop (0.87.1.2)
19
- rubocop (= 0.87.1)
20
- rubocop-performance (= 1.7.0)
21
- rubocop-rails (= 2.6.0)
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.42.0)
23
+ rubocop-rspec (= 2.1.0)
24
24
  ast (2.4.1)
25
- concurrent-ruby (1.1.6)
26
- diff-lcs (1.3)
27
- docile (1.3.2)
28
- i18n (1.8.3)
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
- minitest (5.14.1)
31
- parallel (1.19.2)
32
- parser (2.7.1.4)
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
- qonfig (0.24.1)
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.1)
38
- regexp_parser (1.7.1)
42
+ rake (13.0.3)
43
+ regexp_parser (2.0.3)
39
44
  rexml (3.2.4)
40
- rspec (3.9.0)
41
- rspec-core (~> 3.9.0)
42
- rspec-expectations (~> 3.9.0)
43
- rspec-mocks (~> 3.9.0)
44
- rspec-core (3.9.2)
45
- rspec-support (~> 3.9.3)
46
- rspec-expectations (3.9.2)
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.9.0)
49
- rspec-mocks (3.9.1)
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.9.0)
52
- rspec-support (3.9.3)
53
- rubocop (0.87.1)
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.1)
60
+ parser (>= 2.7.1.5)
56
61
  rainbow (>= 2.2.2, < 4.0)
57
- regexp_parser (>= 1.7)
62
+ regexp_parser (>= 1.8, < 3.0)
58
63
  rexml
59
- rubocop-ast (>= 0.1.0, < 1.0)
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 (0.1.0)
63
- parser (>= 2.7.0.1)
64
- rubocop-performance (1.7.0)
65
- rubocop (>= 0.82.0)
66
- rubocop-rails (2.6.0)
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.82.0)
75
+ rubocop (>= 0.90.0, < 2.0)
70
76
  rubocop-rake (0.5.1)
71
77
  rubocop
72
- rubocop-rspec (1.42.0)
73
- rubocop (>= 0.87.0)
74
- ruby-progressbar (1.10.1)
75
- simplecov (0.18.5)
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
- simplecov-html (0.12.2)
79
- smart_engine (0.7.0)
80
- smart_types (0.1.0)
81
- smart_engine (~> 0.6)
82
- thread_safe (0.3.6)
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 (1.2.7)
85
- thread_safe (~> 0.1)
92
+ tzinfo (2.0.4)
93
+ concurrent-ruby (~> 1.0)
86
94
  unicode-display_width (1.7.0)
87
- zeitwerk (2.3.1)
95
+ zeitwerk (2.4.2)
88
96
 
89
97
  PLATFORMS
90
- ruby
98
+ x86_64-darwin-20
91
99
 
92
100
  DEPENDENCIES
93
- armitage-rubocop (~> 0.87)
94
- bundler (~> 2.1)
101
+ armitage-rubocop (~> 1.7)
102
+ bundler (~> 2.2)
103
+ pry (~> 0.13)
95
104
  rake (~> 13.0)
96
- rspec (~> 3.9)
97
- simplecov (~> 0.18)
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.1.4
111
+ 2.2.3