Sha256: 224002d96748c2cf672845101b1df2a4b7a1c56c7d6b154cf3e95376fd818295
Contents?: true
Size: 1.22 KB
Versions: 2
Compression:
Stored size: 1.22 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 composition, options = {} @composition = composition @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 @composition.validate(&report) nil end end publish_generator Validate, "Perform a thorough validation to check that a compositor is working correctly" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activefacts-compositions-1.9.22 | lib/activefacts/generator/validate.rb |
activefacts-compositions-1.9.21 | lib/activefacts/generator/validate.rb |