smart_types 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/Gemfile.lock +33 -32
  4. data/README.md +161 -16
  5. data/lib/smart_core/types.rb +2 -0
  6. data/lib/smart_core/types/errors.rb +12 -0
  7. data/lib/smart_core/types/primitive.rb +49 -4
  8. data/lib/smart_core/types/primitive/caster.rb +5 -2
  9. data/lib/smart_core/types/primitive/checker.rb +5 -2
  10. data/lib/smart_core/types/primitive/factory.rb +64 -6
  11. data/lib/smart_core/types/primitive/factory/definition_context.rb +37 -11
  12. data/lib/smart_core/types/primitive/factory/runtime_type_builder.rb +53 -0
  13. data/lib/smart_core/types/primitive/invariant_control.rb +6 -3
  14. data/lib/smart_core/types/primitive/invariant_control/chain.rb +5 -2
  15. data/lib/smart_core/types/primitive/invariant_control/single.rb +5 -2
  16. data/lib/smart_core/types/primitive/mult_factory.rb +40 -6
  17. data/lib/smart_core/types/primitive/mult_factory/definition_context.rb +23 -1
  18. data/lib/smart_core/types/primitive/mult_validator.rb +8 -0
  19. data/lib/smart_core/types/primitive/nilable_factory.rb +10 -3
  20. data/lib/smart_core/types/primitive/runtime_attributes_checker.rb +77 -0
  21. data/lib/smart_core/types/primitive/sum_factory.rb +40 -6
  22. data/lib/smart_core/types/primitive/sum_factory/definition_context.rb +23 -1
  23. data/lib/smart_core/types/primitive/sum_validator.rb +18 -2
  24. data/lib/smart_core/types/primitive/undefined_caster.rb +4 -1
  25. data/lib/smart_core/types/primitive/validator.rb +16 -7
  26. data/lib/smart_core/types/protocol.rb +7 -0
  27. data/lib/smart_core/types/protocol/instance_of.rb +19 -0
  28. data/lib/smart_core/types/value/array.rb +3 -0
  29. data/lib/smart_core/types/value/big_decimal.rb +4 -1
  30. data/lib/smart_core/types/value/boolean.rb +3 -0
  31. data/lib/smart_core/types/value/class.rb +3 -0
  32. data/lib/smart_core/types/value/date.rb +3 -0
  33. data/lib/smart_core/types/value/date_time.rb +3 -0
  34. data/lib/smart_core/types/value/enumerable.rb +1 -1
  35. data/lib/smart_core/types/value/float.rb +3 -0
  36. data/lib/smart_core/types/value/hash.rb +3 -0
  37. data/lib/smart_core/types/value/integer.rb +3 -0
  38. data/lib/smart_core/types/value/module.rb +3 -0
  39. data/lib/smart_core/types/value/numeric.rb +3 -0
  40. data/lib/smart_core/types/value/proc.rb +3 -0
  41. data/lib/smart_core/types/value/set.rb +11 -3
  42. data/lib/smart_core/types/value/string.rb +3 -0
  43. data/lib/smart_core/types/value/string_io.rb +2 -0
  44. data/lib/smart_core/types/value/symbol.rb +3 -0
  45. data/lib/smart_core/types/value/text.rb +6 -4
  46. data/lib/smart_core/types/value/time.rb +3 -0
  47. data/lib/smart_core/types/value/time_based.rb +8 -5
  48. data/lib/smart_core/types/variadic.rb +7 -0
  49. data/lib/smart_core/types/variadic/tuple.rb +23 -0
  50. data/lib/smart_core/types/version.rb +2 -2
  51. data/smart_types.gemspec +3 -3
  52. metadata +15 -10
  53. data/.travis.yml +0 -21
@@ -6,7 +6,7 @@ module SmartCore
6
6
  #
7
7
  # @api public
8
8
  # @since 0.1.0
9
- # @version 0.2.0
10
- VERSION = '0.2.0'
9
+ # @version 0.3.0
10
+ VERSION = '0.3.0'
11
11
  end
12
12
  end
@@ -32,12 +32,12 @@ Gem::Specification.new do |spec|
32
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ['lib']
34
34
 
35
- spec.add_dependency 'smart_engine', '~> 0.7'
35
+ spec.add_dependency 'smart_engine', '~> 0.10'
36
36
 
37
37
  spec.add_development_dependency 'bundler', '~> 2.1'
38
38
  spec.add_development_dependency 'rake', '~> 13.0'
39
39
  spec.add_development_dependency 'rspec', '~> 3.10'
40
- spec.add_development_dependency 'armitage-rubocop', '~> 1.3'
41
- spec.add_development_dependency 'simplecov', '~> 0.19'
40
+ spec.add_development_dependency 'armitage-rubocop', '~> 1.6'
41
+ spec.add_development_dependency 'simplecov', '~> 0.20'
42
42
  spec.add_development_dependency 'pry', '~> 0.13'
43
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.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: 2020-11-21 00:00:00.000000000 Z
11
+ date: 2020-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: smart_engine
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '0.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.7'
26
+ version: '0.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.3'
75
+ version: '1.6'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.3'
82
+ version: '1.6'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.19'
89
+ version: '0.20'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.19'
96
+ version: '0.20'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +121,6 @@ files:
121
121
  - ".gitignore"
122
122
  - ".rspec"
123
123
  - ".rubocop.yml"
124
- - ".travis.yml"
125
124
  - CHANGELOG.md
126
125
  - CODE_OF_CONDUCT.md
127
126
  - Gemfile
@@ -138,6 +137,7 @@ files:
138
137
  - lib/smart_core/types/primitive/checker.rb
139
138
  - lib/smart_core/types/primitive/factory.rb
140
139
  - lib/smart_core/types/primitive/factory/definition_context.rb
140
+ - lib/smart_core/types/primitive/factory/runtime_type_builder.rb
141
141
  - lib/smart_core/types/primitive/invariant_control.rb
142
142
  - lib/smart_core/types/primitive/invariant_control/chain.rb
143
143
  - lib/smart_core/types/primitive/invariant_control/chain/result.rb
@@ -153,6 +153,7 @@ files:
153
153
  - lib/smart_core/types/primitive/nilable_factory.rb
154
154
  - lib/smart_core/types/primitive/nilable_validator.rb
155
155
  - lib/smart_core/types/primitive/nilable_validator/result.rb
156
+ - lib/smart_core/types/primitive/runtime_attributes_checker.rb
156
157
  - lib/smart_core/types/primitive/sum_factory.rb
157
158
  - lib/smart_core/types/primitive/sum_factory/definition_context.rb
158
159
  - lib/smart_core/types/primitive/sum_validator.rb
@@ -160,6 +161,8 @@ files:
160
161
  - lib/smart_core/types/primitive/undefined_caster.rb
161
162
  - lib/smart_core/types/primitive/validator.rb
162
163
  - lib/smart_core/types/primitive/validator/result.rb
164
+ - lib/smart_core/types/protocol.rb
165
+ - lib/smart_core/types/protocol/instance_of.rb
163
166
  - lib/smart_core/types/struct.rb
164
167
  - lib/smart_core/types/system.rb
165
168
  - lib/smart_core/types/value.rb
@@ -193,6 +196,8 @@ files:
193
196
  - lib/smart_core/types/value/time.rb
194
197
  - lib/smart_core/types/value/time_based.rb
195
198
  - lib/smart_core/types/value/unbound_method.rb
199
+ - lib/smart_core/types/variadic.rb
200
+ - lib/smart_core/types/variadic/tuple.rb
196
201
  - lib/smart_core/types/version.rb
197
202
  - smart_types.gemspec
198
203
  homepage: https://github.com/smart-rb/smart_types
@@ -217,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
222
  - !ruby/object:Gem::Version
218
223
  version: '0'
219
224
  requirements: []
220
- rubygems_version: 3.2.0.rc.1
225
+ rubygems_version: 3.1.4
221
226
  signing_key:
222
227
  specification_version: 4
223
228
  summary: Full-featured type system for any ruby project.
@@ -1,21 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- os: linux
5
- dist: xenial
6
- before_install: gem install bundler
7
- script:
8
- - bundle exec rake rubocop
9
- - bundle exec rake rspec
10
- jobs:
11
- fast_finish: true
12
- include:
13
- - rvm: 2.4.10
14
- - rvm: 2.5.8
15
- - rvm: 2.6.6
16
- - rvm: 2.7.1
17
- - rvm: ruby-head
18
- - rvm: jruby-head
19
- allow_failures:
20
- - rvm: ruby-head
21
- - rvm: jruby-head