class LiquidDiagrams::Renderers::GraphvizRenderer

Constants

CONFIG_MAPPERS
XML_REGEX

Public Instance Methods

arguments() click to toggle source
# File lib/liquid_diagrams/renderers/graphviz_renderer.rb, line 24
def arguments
  @config.slice(*CONFIG_MAPPERS.keys).map do |opt, attrs|
    Utils.join(attrs, with: " -#{CONFIG_MAPPERS[opt]}") do |attr|
      Array(attr).join('=')
    end
  end.join(' ')
end
executable() click to toggle source
# File lib/liquid_diagrams/renderers/graphviz_renderer.rb, line 20
def executable
  'dot -Tsvg'
end
render() click to toggle source
# File lib/liquid_diagrams/renderers/graphviz_renderer.rb, line 15
def render
  Rendering.render_with_stdin_stdout(build_command, @content)
           .encode('utf-8').sub(XML_REGEX, '')
end