evt-schema 2.3.1.3 → 2.3.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/schema/schema.rb +7 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b428a68d93f45e5bd364e815d925c82645e38025fc00c9204ae9b3e0f4f09b1
4
- data.tar.gz: 39063eab4c9e83332a4963b1cb5a640279b245f9355d39783b368ba94bdf469b
3
+ metadata.gz: 971bea799a068571a832fd0d91d795d358b4bf2353815af0deeba7bd06575f2b
4
+ data.tar.gz: ce668827143bc600c0cff547599342ef8b407360532645b31fa316e6b183cb6d
5
5
  SHA512:
6
- metadata.gz: 4e2d106b624da65230439ba3d62b8c8ba162b60ed60d03506753c4fe6da9c176a8ede38fa587bdeeeca858354d3fd15f539c5c476a26a2d4d70160f2eab7b43d
7
- data.tar.gz: fac1fd85a1cfa3bdb9f4bb2577e5f3548fe254b61c099ee7adf55ac04e4ce39a0fa99ba46726949d29e5f5164cc8b280e16b3d3ae0bbe61fc92e8841e6487fdc
6
+ metadata.gz: f574566d0440bfee26e16529dcd2d577c29d7a38ec6db7a50d8b2241f100fd3fbb31a6a8138983b8c48d006576f2d73505a90359b80d73b62b0382bd7a052107
7
+ data.tar.gz: 5a5d352f13748253fb1a0b499d21305e2a750c14ca2e4d0d6026fcb2f9e53650199e1a7280fdd20585c4a9faad55ccc15b680875b7559dfeb96daf3c48c7b031
data/lib/schema/schema.rb CHANGED
@@ -41,7 +41,7 @@ module Schema
41
41
 
42
42
  check = proc do |val|
43
43
  unless val.nil? || Boolean.(val)
44
- raise Schema::Attribute::TypeError, "#{val.inspect} is not a boolean"
44
+ raise Schema::Attribute::TypeError, "#{val.inspect} of type #{val.class.name} cannot be assigned to attribute #{attribute_name} of type Boolean (Strict: #{strict.inspect})"
45
45
  end
46
46
  end
47
47
  elsif !type.nil?
@@ -50,9 +50,13 @@ module Schema
50
50
  check = proc do |val|
51
51
  unless val.nil?
52
52
  if strict
53
- raise Schema::Attribute::TypeError, "#{val.inspect} is not an instance of #{type.name}" unless val.instance_of? type
53
+ if not val.instance_of?(type)
54
+ raise Schema::Attribute::TypeError, "#{val.inspect} of type #{val.class.name} cannot be assigned to attribute #{attribute_name} of type #{type.name} (Strict: #{strict.inspect})"
55
+ end
54
56
  else
55
- raise Schema::Attribute::TypeError, "#{val.inspect} is not a kind of #{type.name}" unless val.is_a? type
57
+ if not val.is_a?(type)
58
+ raise Schema::Attribute::TypeError, "#{val.inspect} of type #{val.class.name} cannot be assigned to attribute #{attribute_name} of type #{type.name} (Strict: #{strict.inspect})"
59
+ end
56
60
  end
57
61
  end
58
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1.3
4
+ version: 2.3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-12 00:00:00.000000000 Z
11
+ date: 2022-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-attribute