Class: LiquidDiagrams::Renderers::PlantumlRenderer

Inherits:
BasicRenderer
  • Object
show all
Defined in:
lib/liquid_diagrams/renderers/plantuml_renderer.rb

Constant Summary collapse

XML_REGEX =
/^<\?xml([^>]|\n)*>\n?/.freeze

Constants inherited from BasicRenderer

BasicRenderer::FLAGS, BasicRenderer::FLAGS_PREFIX, BasicRenderer::OPTIONS, BasicRenderer::OPTIONS_PREFIX, BasicRenderer::OPTIONS_SEPARATOR

Instance Method Summary collapse

Methods inherited from BasicRenderer

#arguments, #build_command, #initialize, render

Methods included from LiquidDiagrams::Rendering

render_with_command, render_with_stdin_stdout, render_with_tempfile

Constructor Details

This class inherits a constructor from LiquidDiagrams::BasicRenderer

Instance Method Details

#executableObject



13
14
15
16
17
# File 'lib/liquid_diagrams/renderers/plantuml_renderer.rb', line 13

def executable
  jar_path = Utils.vendor_path('plantuml.1.2020.1.jar')

  "#{Utils.run_jar(jar_path)} -tsvg -pipe"
end

#renderObject



8
9
10
11
# File 'lib/liquid_diagrams/renderers/plantuml_renderer.rb', line 8

def render
  Rendering.render_with_stdin_stdout(build_command, @content)
           .sub(XML_REGEX, '')
end