smart_types 0.1.0.alpha → 0.1.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +1 -0
- data/lib/smart_core/types/errors.rb +4 -0
- data/lib/smart_core/types/primitive.rb +12 -0
- data/lib/smart_core/types/version.rb +1 -1
- data/smart_types.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb0ae0383bdc9445db3ea63c4aa54bb6bfb733ae0d092a35454eb1c5892849d
|
4
|
+
data.tar.gz: 5d15ac45b21a85e965feb00f45419d125638578941eee86a56cb9088f60249fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9ac3108ef4bdc56cd6618312b56e78eb328461e54ef9bcd09ef9daf7f808b121dfb7d3e196596455eebcdaf69a4426fcfa5066d1f584c74138114cade5e8770
|
7
|
+
data.tar.gz: 6ca41544a3c80c8573971f63135224d67c21b72ba5c4cbd0137086a6a1f5edd5d736708178472dd009c4e648d37527e3e8416af008d17120dbd26d3a6b8c299c
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
smart_types (0.1.0)
|
5
|
-
smart_engine (~> 0.
|
4
|
+
smart_types (0.1.0.alpha)
|
5
|
+
smart_engine (~> 0.5)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -59,7 +59,7 @@ GEM
|
|
59
59
|
json (>= 1.8, < 3)
|
60
60
|
simplecov-html (~> 0.10.0)
|
61
61
|
simplecov-html (0.10.2)
|
62
|
-
smart_engine (0.
|
62
|
+
smart_engine (0.5.0)
|
63
63
|
unicode-display_width (1.6.0)
|
64
64
|
|
65
65
|
PLATFORMS
|
data/README.md
CHANGED
@@ -52,6 +52,18 @@ class SmartCore::Types::Primitive
|
|
52
52
|
checker.call(value)
|
53
53
|
end
|
54
54
|
|
55
|
+
# @return [void]
|
56
|
+
#
|
57
|
+
# @raise [SmartCore::TypeError]
|
58
|
+
#
|
59
|
+
# @api public
|
60
|
+
# @since 0.1.0
|
61
|
+
def validate!(value)
|
62
|
+
valid?(value) || raise(SmartCore::Types::TypeError, <<~ERROR_MESSAGE)
|
63
|
+
Invalid type (given #{value.class}, expects #{self}-related)
|
64
|
+
ERROR_MESSAGE
|
65
|
+
end
|
66
|
+
|
55
67
|
# @param value [Any]
|
56
68
|
# @return [Any]
|
57
69
|
#
|
data/smart_types.gemspec
CHANGED
@@ -32,7 +32,7 @@ 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.
|
35
|
+
spec.add_dependency 'smart_engine', '~> 0.5'
|
36
36
|
|
37
37
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
38
38
|
spec.add_development_dependency 'rake', '~> 13.0'
|
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.1.0.
|
4
|
+
version: 0.1.0.alpha2
|
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-01-
|
11
|
+
date: 2020-01-22 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.
|
19
|
+
version: '0.5'
|
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.
|
26
|
+
version: '0.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|