From af521fade9bf64704bab00ddf5d81aa1f987fb7e Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Wed, 7 Apr 2010 23:10:21 -0700 Subject: Adding #3518 - basic dot format support This allows you to ask for a node's catalog in dot format, for inputting into graphviz et al. Signed-off-by: Luke Kanies --- lib/puppet/network/formats.rb | 3 +++ spec/unit/network/formats.rb | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/puppet/network/formats.rb b/lib/puppet/network/formats.rb index 62569d4b1..92f778c70 100644 --- a/lib/puppet/network/formats.rb +++ b/lib/puppet/network/formats.rb @@ -186,3 +186,6 @@ Puppet::Network::FormatHandler.create(:pson, :mime => "text/pson", :weight => 10 klass.from_pson(data) end end + +# This is really only ever going to be used for Catalogs. +Puppet::Network::FormatHandler.create(:dot, :mime => "text/dot", :required_methods => [:render_method]) diff --git a/spec/unit/network/formats.rb b/spec/unit/network/formats.rb index 7b0c0adba..78b35fd13 100755 --- a/spec/unit/network/formats.rb +++ b/spec/unit/network/formats.rb @@ -263,6 +263,16 @@ describe "Puppet Network Format" do end end + describe "dot" do + before do + @dot = Puppet::Network::FormatHandler.format(:dot) + end + + it "should have its mimetype set to text/dot" do + @dot.mime.should == "text/dot" + end + end + describe Puppet::Network::FormatHandler.format(:raw) do before do @format = Puppet::Network::FormatHandler.format(:raw) -- cgit