uinit-type 0.1.6 → 0.1.7
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 +4 -4
- data/lib/uinit/type/float.rb +2 -1
- data/lib/uinit/type/integer.rb +2 -0
- data/lib/uinit/type/string.rb +2 -0
- data/lib/uinit/type/type_of.rb +1 -1
- data/lib/uinit/type/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f997cfcc44febfb12672561136eae00f9b87fc9931dab1e8a3e194dfe2cbb672
|
4
|
+
data.tar.gz: ea33520aa33c273c82e1e67a505ab06ab83b1639094e890847d702eedf6e93b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 107befa7e3e4a6ff7c3ecccd22f2760f9bd9bbd8de403b714c257d818a69740ffa662cd5170c8e32332d611cca9ad96b002ae6d0389631ab35262fe0f5e429ce
|
7
|
+
data.tar.gz: 0c7d307cc9189c1de58ca221342d0d9a39924750443deae2499c7e11d8f3e93362fd4520225f470fc91bf73cfc1713b56ac3fe7bef5836ab78b4afc68388aac8
|
data/lib/uinit/type/float.rb
CHANGED
@@ -38,6 +38,8 @@ module Uinit
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def check!(value, depth)
|
41
|
+
super
|
42
|
+
|
41
43
|
type_error!('Float must be finite (not Infinity or NaN)', depth) if finite && !value.finite?
|
42
44
|
type_error!("Float too small (minimum #{min})", depth) if min && value < min
|
43
45
|
type_error!("Float too large (maximum #{max})", depth) if max && value > max
|
@@ -61,7 +63,6 @@ module Uinit
|
|
61
63
|
def valid_precision?(value)
|
62
64
|
return true if precision.nil?
|
63
65
|
|
64
|
-
# Compter les décimales
|
65
66
|
decimal_places = value.to_s.split('.').last&.length || 0
|
66
67
|
decimal_places <= precision
|
67
68
|
end
|
data/lib/uinit/type/integer.rb
CHANGED
@@ -32,6 +32,8 @@ module Uinit
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def check!(value, depth)
|
35
|
+
super
|
36
|
+
|
35
37
|
type_error!("Integer too small (minimum #{min})", depth) if min && value < min
|
36
38
|
type_error!("Integer too large (maximum #{max})", depth) if max && value > max
|
37
39
|
type_error!('Integer cannot be positive', depth) if positive == false && value.positive?
|
data/lib/uinit/type/string.rb
CHANGED
data/lib/uinit/type/type_of.rb
CHANGED
data/lib/uinit/type/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uinit-type
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kimoja
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|