lib/depcheck/output/graph_output.rb in depcheck-0.4.0 vs lib/depcheck/output/graph_output.rb in depcheck-0.5.0

- old
+ new

@@ -1,9 +1,9 @@ module Depcheck class GraphOutput - def post(objs, include) + def post(objs, include, dot) # installs graphviz if needed system 'brew install graphviz' unless graphviz_installed? # Check that this is in the user's PATH after installing @@ -19,13 +19,15 @@ File.open("#{file_name}.dot", 'w') do |f| f.write(graph) end # run dot command - `dot -T png #{file_name}.dot > #{file_name}.png && open #{file_name}.png` - - # remove temporary file - File.delete("#{file_name}.dot") + if dot + `dot -T png #{file_name}.dot` + elsif + `dot -T png #{file_name}.dot > #{file_name}.png && open #{file_name}.png` + File.delete("#{file_name}.dot") + end end def generate_graph_description(objs, include) nodes = [] objs.each do |obj|