Module: ArchUnit::Slices::Uml::PlantUmlParser
- Defined in:
- lib/archunit/slices/uml/parse_diagram.rb
Overview
Line-based parser for PlantUML component declarations and directed arrows.
Constant Summary collapse
- COMPONENT =
/\Acomponent\s+\[([^\]]+)\]/i- DEPENDENCY =
/\A\[([^\]]+)\]\s*-{1,2}>\s*\[([^\]]+)\]/
Class Method Summary collapse
Class Method Details
.parse(text) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/archunit/slices/uml/parse_diagram.rb', line 16 def parse(text) unless text.is_a?(String) && !text.strip.empty? raise ArgumentError, 'diagram text must be a non-empty String' end components = [] dependencies = [] text.each_line do |line| parse_line(line, components, dependencies) end PlantUmlDiagram.new(components:, dependencies:) end |