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 74 def evaluate(graph) relevant_edges(graph).flat_map do |edge| forbidden = target_components(graph, edge) & targets forbidden.map do |target| Diagnostic.new( rule: id, message: "#{source} must not depend on #{target}", location: edge.location, evidence: "#{edge.from_constant || edge.from_path} #{edge.type} #{edge_target(edge)}" ) end end end
Source
# File lib/archspec/rules/dependency_rules.rb, line 70 def id 'dependencies.forbid' end