smart_initializer 0.10.0 → 0.11.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: f071c193e7dba7c0e30acf950159bc97f41933bbb7a6cb2e04838b1de474c0d7
4
- data.tar.gz: 5867c7ffc8181767a85ad0d609ca3a1d9c6697e4eb0abaa3e9997341cc237165
3
+ metadata.gz: '080bf0d03a329010fb6976667957ab028a86e4978fc9874e85fe51b832ecb365'
4
+ data.tar.gz: 0b37fbe8b446cacd16ac7bdbc1cf2f3a4284365b4c4cbf93ba5e11e8ede5b18e
5
5
  SHA512:
6
- metadata.gz: e964ae02c95f010da48499b508c8f5bd755aa0b44165fe173dcdd80385f4c1006fc469ebf5568303f5f47e58cb514c0f4a1e10b5062b2db5b953f57b3bda8549
7
- data.tar.gz: 8907288d0ff34f3f76d6bf5291cce236413ef998a944966f90074e871126809b98c7ed16890ecf84a338da22096e108a6d40d84f640d602628ae97a5cc9656fd
6
+ metadata.gz: 10240a1be814be9fc50d997f6bb87b6ce8d1ea545bb0582b19f6853ab0b1031644dff6e72df323e8bfb812bd7691c8526d26dd396bfa02a24aa63c099c6b2b60
7
+ data.tar.gz: 9ecfcfe2084cbb354ee85fb6a73c2931a0304eaed0bcf9a498edf7307b908a45fc1edd037731bfb9cdc576d414b7485ddc545ee7b31058cc93ec6d5db71e149c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [0.11.0] - 2022-11-25
5
+ ### Changed
6
+ - Support for *Ruby@2.5* and *Ruby@2.6* has ended;
7
+ - Reduced object allocation count during type checking process;
8
+ - Removed useless `Incorrect type` text part from `SmartCore::Initializer::IncorrectTypeError` exception message;
9
+ - Updated development dependencies;
10
+
4
11
  ## [0.10.0] - 2022-10-04
5
12
  ### Changed
6
13
  - `SmartCore::Engine::ReadWriteLock` is used instead `SmartCore::Engine::Lock` in order to decrease the count of RubyVM's context switching and useless Mutexes usage;
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_initializer (0.10.0)
4
+ smart_initializer (0.11.0)
5
5
  qonfig (~> 0.24)
6
6
  smart_engine (~> 0.16)
7
7
  smart_types (~> 0.7)
@@ -14,12 +14,12 @@ GEM
14
14
  i18n (>= 1.6, < 2)
15
15
  minitest (>= 5.1)
16
16
  tzinfo (~> 2.0)
17
- armitage-rubocop (1.30.1.1)
18
- rubocop (= 1.30.1)
19
- rubocop-performance (= 1.14.2)
20
- rubocop-rails (= 2.15.0)
17
+ armitage-rubocop (1.36.0)
18
+ rubocop (= 1.36.0)
19
+ rubocop-performance (= 1.15.0)
20
+ rubocop-rails (= 2.16.1)
21
21
  rubocop-rake (= 0.6.0)
22
- rubocop-rspec (= 2.11.1)
22
+ rubocop-rspec (= 2.13.2)
23
23
  ast (2.4.2)
24
24
  coderay (1.1.3)
25
25
  concurrent-ruby (1.1.10)
@@ -27,6 +27,7 @@ GEM
27
27
  docile (1.4.0)
28
28
  i18n (1.12.0)
29
29
  concurrent-ruby (~> 1.0)
30
+ json (2.6.2)
30
31
  method_source (1.0.0)
31
32
  minitest (5.16.3)
32
33
  parallel (1.22.1)
@@ -36,46 +37,47 @@ GEM
36
37
  coderay (~> 1.1)
37
38
  method_source (~> 1.0)
38
39
  qonfig (0.28.0)
39
- rack (3.0.0)
40
+ rack (3.0.1)
40
41
  rainbow (3.1.1)
41
42
  rake (13.0.6)
42
- regexp_parser (2.6.0)
43
+ regexp_parser (2.6.1)
43
44
  rexml (3.2.5)
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)
45
+ rspec (3.12.0)
46
+ rspec-core (~> 3.12.0)
47
+ rspec-expectations (~> 3.12.0)
48
+ rspec-mocks (~> 3.12.0)
49
+ rspec-core (3.12.0)
50
+ rspec-support (~> 3.12.0)
51
+ rspec-expectations (3.12.0)
51
52
  diff-lcs (>= 1.2.0, < 2.0)
52
- rspec-support (~> 3.11.0)
53
- rspec-mocks (3.11.1)
53
+ rspec-support (~> 3.12.0)
54
+ rspec-mocks (3.12.0)
54
55
  diff-lcs (>= 1.2.0, < 2.0)
55
- rspec-support (~> 3.11.0)
56
- rspec-support (3.11.1)
57
- rubocop (1.30.1)
56
+ rspec-support (~> 3.12.0)
57
+ rspec-support (3.12.0)
58
+ rubocop (1.36.0)
59
+ json (~> 2.3)
58
60
  parallel (~> 1.10)
59
- parser (>= 3.1.0.0)
61
+ parser (>= 3.1.2.1)
60
62
  rainbow (>= 2.2.2, < 4.0)
61
63
  regexp_parser (>= 1.8, < 3.0)
62
64
  rexml (>= 3.2.5, < 4.0)
63
- rubocop-ast (>= 1.18.0, < 2.0)
65
+ rubocop-ast (>= 1.20.1, < 2.0)
64
66
  ruby-progressbar (~> 1.7)
65
67
  unicode-display_width (>= 1.4.0, < 3.0)
66
- rubocop-ast (1.21.0)
68
+ rubocop-ast (1.23.0)
67
69
  parser (>= 3.1.1.0)
68
- rubocop-performance (1.14.2)
70
+ rubocop-performance (1.15.0)
69
71
  rubocop (>= 1.7.0, < 2.0)
70
72
  rubocop-ast (>= 0.4.0)
71
- rubocop-rails (2.15.0)
73
+ rubocop-rails (2.16.1)
72
74
  activesupport (>= 4.2.0)
73
75
  rack (>= 1.1)
74
- rubocop (>= 1.7.0, < 2.0)
76
+ rubocop (>= 1.33.0, < 2.0)
75
77
  rubocop-rake (0.6.0)
76
78
  rubocop (~> 1.0)
77
- rubocop-rspec (2.11.1)
78
- rubocop (~> 1.19)
79
+ rubocop-rspec (2.13.2)
80
+ rubocop (~> 1.33)
79
81
  ruby-progressbar (1.11.0)
80
82
  simplecov (0.21.2)
81
83
  docile (~> 1.1)
@@ -83,8 +85,8 @@ GEM
83
85
  simplecov_json_formatter (~> 0.1)
84
86
  simplecov-html (0.12.3)
85
87
  simplecov_json_formatter (0.1.4)
86
- smart_engine (0.16.0)
87
- smart_types (0.7.1)
88
+ smart_engine (0.17.0)
89
+ smart_types (0.8.0)
88
90
  smart_engine (~> 0.11)
89
91
  tzinfo (2.0.5)
90
92
  concurrent-ruby (~> 1.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- smart_initializer (0.10.0)
4
+ smart_initializer (0.11.0)
5
5
  qonfig (~> 0.24)
6
6
  smart_engine (~> 0.16)
7
7
  smart_types (~> 0.7)
@@ -83,8 +83,8 @@ GEM
83
83
  simplecov_json_formatter (~> 0.1)
84
84
  simplecov-html (0.12.3)
85
85
  simplecov_json_formatter (0.1.4)
86
- smart_engine (0.16.0)
87
- smart_types (0.7.1)
86
+ smart_engine (0.17.0)
87
+ smart_types (0.8.0)
88
88
  smart_engine (~> 0.11)
89
89
  thy (0.1.4)
90
90
  tzinfo (2.0.5)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- smart_initializer (0.10.0)
4
+ smart_initializer (0.11.0)
5
5
  qonfig (~> 0.24)
6
6
  smart_engine (~> 0.16)
7
7
  smart_types (~> 0.7)
@@ -83,8 +83,8 @@ GEM
83
83
  simplecov_json_formatter (~> 0.1)
84
84
  simplecov-html (0.12.3)
85
85
  simplecov_json_formatter (0.1.4)
86
- smart_engine (0.16.0)
87
- smart_types (0.7.1)
86
+ smart_engine (0.17.0)
87
+ smart_types (0.8.0)
88
88
  smart_engine (~> 0.11)
89
89
  tzinfo (2.0.5)
90
90
  concurrent-ruby (~> 1.0)
@@ -2,6 +2,7 @@
2
2
 
3
3
  # @api private
4
4
  # @since 0.8.0
5
+ # @version 0.11.0
5
6
  class SmartCore::Initializer::Attribute::Value::Base
6
7
  # @return [Hash<Symbol,Symbol>]
7
8
  #
@@ -114,15 +115,16 @@ class SmartCore::Initializer::Attribute::Value::Base
114
115
  # @param value [Any]
115
116
  # @return [void]
116
117
  #
118
+ # @raise [SmartCore::Initializer::IncorrectTypeError]
119
+ #
117
120
  # @api private
118
121
  # @since 0.8.0
122
+ # @version 0.11.0
119
123
  def validate!(value)
120
- type.validate!(value)
121
- rescue => error # TODO: move to typesystem interop
122
124
  raise(
123
125
  SmartCore::Initializer::IncorrectTypeError,
124
126
  "Validation of attribute `#{name}` failed:" \
125
- "(expected: #{type.identifier}, got: #{value.class}) \"#{error.message}\""
126
- )
127
+ "(expected: #{type.identifier}, got: #{value.class})"
128
+ ) unless type.valid?(value)
127
129
  end
128
130
  end
@@ -11,7 +11,7 @@ class SmartCore::Initializer::Settings::AutoCast < SmartCore::Initializer::Setti
11
11
  # @version 0.10.0
12
12
  def resolve
13
13
  @lock.read_sync do
14
- @value == nil ? SmartCore::Initializer::Configuration[:auto_cast] : @value
14
+ (@value == nil) ? SmartCore::Initializer::Configuration[:auto_cast] : @value
15
15
  end
16
16
  end
17
17
 
@@ -11,7 +11,7 @@ class SmartCore::Initializer::Settings::StrictOptions < SmartCore::Initializer::
11
11
  # @version 0.10.0
12
12
  def resolve
13
13
  @lock.read_sync do
14
- @value == nil ? SmartCore::Initializer::Configuration[:strict_options] : @value
14
+ (@value == nil) ? SmartCore::Initializer::Configuration[:strict_options] : @value
15
15
  end
16
16
  end
17
17
 
@@ -22,7 +22,7 @@ class SmartCore::Initializer::Settings::TypeSystem < SmartCore::Initializer::Set
22
22
  # @version 0.10.0
23
23
  def resolve
24
24
  @lock.read_sync do
25
- @value == nil ? SmartCore::Initializer::Configuration[:default_type_system] : @value
25
+ (@value == nil) ? SmartCore::Initializer::Configuration[:default_type_system] : @value
26
26
  end
27
27
  end
28
28
 
@@ -6,7 +6,7 @@ module SmartCore
6
6
  #
7
7
  # @api public
8
8
  # @since 0.1.0
9
- # @version 0.10.0
10
- VERSION = '0.10.0'
9
+ # @version 0.11.0
10
+ VERSION = '0.11.0'
11
11
  end
12
12
  end
@@ -3,7 +3,7 @@
3
3
  require_relative 'lib/smart_core/initializer/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.required_ruby_version = Gem::Requirement.new('>= 2.5')
6
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.7')
7
7
 
8
8
  spec.name = 'smart_initializer'
9
9
  spec.version = SmartCore::Initializer::VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_initializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Ibragimov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-03 00:00:00.000000000 Z
11
+ date: 2022-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: smart_engine
@@ -239,14 +239,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
239
  requirements:
240
240
  - - ">="
241
241
  - !ruby/object:Gem::Version
242
- version: '2.5'
242
+ version: '2.7'
243
243
  required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  requirements:
245
245
  - - ">="
246
246
  - !ruby/object:Gem::Version
247
247
  version: '0'
248
248
  requirements: []
249
- rubygems_version: 3.3.11
249
+ rubygems_version: 3.3.7
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: Initializer DSL