evt-schema 1.2.0.1 → 1.2.2.0

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: af644a3b7fe66d6f672f8fb4b92ba1a4c67cfc558776e469f2130cf08b5eeb8c
4
- data.tar.gz: 98fe792324d4c7a6ca30ac65c05218f5741eccab7ba671f2cde2d262db538fb4
3
+ metadata.gz: bb4716312607b047f05ccc6c3992228740e8c07be998f66991c82a535ca2916a
4
+ data.tar.gz: c12042426194c4b2de2e382f1191d62d5a5e4f43068465ce63e02db3d7599da8
5
5
  SHA512:
6
- metadata.gz: 6081d76ea3cc41a64bf6b79c56e3dbd4972c729a9dc98d2c83200f23ceeccdbe954e7e5ef60b93de2b7d9403734621608cb672ebc2364830715e9affeae0f627
7
- data.tar.gz: 45333371f6d2c5224030a1a5770ced98207fba5a8839fab49932236c5cb0bb8947db67328f5d53f6cf362b56b0ec731ae22369ec2cdd20ec27200cce74e1c618
6
+ metadata.gz: 815d23bd66d652b8b69acf5786a6fa3bef1be7f67c130cd63bcad0350cdae74a8ef35bc13391de7e6069df68572e7c47e4abf363fb8bb697af0640050efa550b
7
+ data.tar.gz: 6f9bb75f9d6304b71c2d15bc62c43fc90600b7b10728ff5c1ca08a19700073d9bc2ce21228bacd7df13a5e94527a0644e69d7bd643dc5320d4fedeeb096acd27
data/lib/schema.rb CHANGED
@@ -4,7 +4,6 @@ require 'validate'
4
4
  require 'virtual'
5
5
 
6
6
  require 'schema/schema'
7
- require 'schema/schema/assertions'
8
7
  require 'schema/schema/attribute'
9
8
  require 'schema/data_structure'
10
9
  require 'schema/validation/nil_attributes'
data/lib/schema/schema.rb CHANGED
@@ -6,12 +6,8 @@ module Schema
6
6
  extend AttributeMacro
7
7
  extend Attributes
8
8
 
9
- # This is done as a countermeasure for incompatibility
10
- # between Virtual and an Assertions module
11
- # include Virtual
12
- # virtual :transform_write
13
- define_method(:transform_write) {|data|}
14
- #
9
+ include Virtual
10
+ virtual :transform_write
15
11
 
16
12
  const_set(:Boolean, Boolean)
17
13
  end
@@ -188,4 +184,27 @@ module Schema
188
184
  def ===(other)
189
185
  self.eql?(other, ignore_class: true)
190
186
  end
187
+
188
+ def attributes_equal?(other, attributes=nil, print: nil)
189
+ attributes ||= self.class.attribute_names
190
+
191
+ print = true if print.nil?
192
+ print ||= false
193
+
194
+ equal = self.eql?(other, attributes, ignore_class: true)
195
+
196
+ if !equal && print
197
+ attributes = Array(attributes)
198
+
199
+ require 'pp'
200
+ puts "self: #{self.class.name}"
201
+ pp self.attributes.select { |k, v| attributes.include? k }
202
+ puts "other #{other.class.name}:"
203
+ pp other.attributes.select { |k, v| attributes.include? k }
204
+ puts "attributes:"
205
+ attributes.each { |a| puts a.inspect}
206
+ end
207
+
208
+ equal
209
+ end
191
210
  end
@@ -23,4 +23,5 @@ module Schema
23
23
  equal
24
24
  end
25
25
  end
26
+ include Assertions
26
27
  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: 1.2.0.1
4
+ version: 1.2.2.0
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: 2019-10-14 00:00:00.000000000 Z
11
+ date: 2019-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-attribute