Sha256: 690a26c04acbdf7f609dc1304b5a558ccef88be864b5d48df611caec39490edc
Contents?: true
Size: 1.17 KB
Versions: 2
Compression:
Stored size: 1.17 KB
Contents
# # ActiveFacts Compositions, Metamodel aspect to look for validation errors in a composition # # Quite a few constraints are not enforced during the construction of a composition. # This method does a post-validation to ensure that everything looks ok. # # Copyright (c) 2015 Clifford Heath. Read the LICENSE file. # require "activefacts/metamodel" require "activefacts/metamodel/validate/composition" require "activefacts/compositions/compositor" require "activefacts/generator" module ActiveFacts module Generators class Validate def self.options { } end def initialize compositions, options = {} @compositions = compositions @options = options end def generate &report if !report trace.enable 'composition_validator' report ||= proc do |component, problem| trace :composition_validator, "!!PROBLEM!! #{component.inspect}: #{problem}" debugger if trace :composition_validator_debug component end end @compositions.each{ |composition| composition.validate(&report) } nil end end publish_generator Validate end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activefacts-compositions-1.9.10 | lib/activefacts/generator/validate.rb |
activefacts-compositions-1.9.9 | lib/activefacts/generator/validate.rb |