require 'nokogiri' module Tests class NamesAccessor def initialize(graph) @graph = graph end def containers names @graph.container_nodes end def things names @graph.thing_nodes end def edges names @graph.edge_nodes end private attr_reader :graph def names(nodes) nodes.map { |g| g.css('text').text } end end class SvgGraph def self.parse_file(svg_filename) SvgGraph.new File.read(svg_filename) end def initialize(svg) @doc = Nokogiri::XML(svg) {|config| config.noblanks } end def title title_prefix = '