class ArchSpec::Rules::ForbidDependenciesRule
Backs ArchSpec::DSL::ComponentProxy#cannot_use. Flags references from the source to any of the named components.
Public Instance Methods
Source
# File lib/archspec/rules/dependency_rules.rb, line 66 def evaluate(graph) relevant_edges(graph).flat_map do |edge| forbidden = graph.target_components_for(edge) & targets forbidden.map do |target| Diagnostic.new( rule: id, message: "#{source} must not depend on #{target}", location: edge.location, evidence: "#{graph.edge_source_name(edge)} #{edge.verb} #{edge.to}" ) end end end
Source
# File lib/archspec/rules/dependency_rules.rb, line 62 def id 'dependencies.forbid' end