smart_initializer 0.10.0 → 0.11.1

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: 8fe201fc92a2d434aa3b1172e41d9087198d77e63282a9e98ed1da9a9aab6668
4
+ data.tar.gz: 23898d45402508f8baba6f377f60833c0388a269fbef4ab25a31e11f48578f12
5
5
  SHA512:
6
- metadata.gz: e964ae02c95f010da48499b508c8f5bd755aa0b44165fe173dcdd80385f4c1006fc469ebf5568303f5f47e58cb514c0f4a1e10b5062b2db5b953f57b3bda8549
7
- data.tar.gz: 8907288d0ff34f3f76d6bf5291cce236413ef998a944966f90074e871126809b98c7ed16890ecf84a338da22096e108a6d40d84f640d602628ae97a5cc9656fd
6
+ metadata.gz: 8df5d054733685007a706f980e5f2fb4e7a6155d617c6726f6bcb977a7833af4850c8e69b187870dd02330fbe9a821587c8ee40270f225f0324aa75b02bcfdb6
7
+ data.tar.gz: 2796450e1c53a909d692916d5087bcb3059bfd1165078d3758d79aa372f62cdbde7c7b6d6bbe97a41c811239e7595d2a49b76b9ef675e6186b10ef3f907ba5a9
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,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- smart_initializer (0.10.0)
4
+ smart_initializer (0.11.1)
5
5
  qonfig (~> 0.24)
6
6
  smart_engine (~> 0.16)
7
- smart_types (~> 0.7)
7
+ smart_types (~> 0.8)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -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,10 +1,10 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- smart_initializer (0.10.0)
4
+ smart_initializer (0.11.1)
5
5
  qonfig (~> 0.24)
6
6
  smart_engine (~> 0.16)
7
- smart_types (~> 0.7)
7
+ smart_types (~> 0.8)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -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.1
10
+ VERSION = '0.11.1'
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
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.require_paths = ['lib']
32
32
 
33
33
  spec.add_dependency 'smart_engine', '~> 0.16'
34
- spec.add_dependency 'smart_types', '~> 0.7'
34
+ spec.add_dependency 'smart_types', '~> 0.8'
35
35
  spec.add_dependency 'qonfig', '~> 0.24'
36
36
 
37
37
  spec.add_development_dependency 'bundler', '~> 2.3'
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.1
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
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.7'
33
+ version: '0.8'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.7'
40
+ version: '0.8'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: qonfig
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -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