251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
# File 'lib/puppet/graph/simple_graph.rb', line 251
def write_cycles_to_graph(cycles)
graph = ["digraph Resource_Cycles {"]
graph << ' label = "Resource Cycles"'
cycles.each do |cycle|
paths_in_cycle(cycle, 10).each do |path|
graph << path.map { |v| '"' + v.to_s.gsub(/"/, '\\"') + '"' }.join(" -> ")
end
end
graph << '}'
filename = File.join(Puppet[:graphdir], "cycles.dot")
File.open(filename, "w:UTF-8") { |f| f.puts graph }
filename
end
|