Class: Nanoc::Graphviz::Filter
- Inherits:
-
Filter
- Object
- Filter
- Nanoc::Graphviz::Filter
- Defined in:
- lib/nanoc/graphviz/filter.rb
Overview
Graphviz Filter class
Instance Method Summary collapse
-
#ready? ⇒ Boolean
check runtime envs.
-
#run(content, _ = {}) ⇒ Integer
convert Graphviz code to image.
Instance Method Details
#ready? ⇒ Boolean
check runtime envs
28 29 30 |
# File 'lib/nanoc/graphviz/filter.rb', line 28 def ready? graphviz_ready? end |
#run(content, _ = {}) ⇒ Integer
convert Graphviz code to image
18 19 20 21 22 23 |
# File 'lib/nanoc/graphviz/filter.rb', line 18 def run(content, _ = {}) fail 'Runtime environments is not ready' unless ready? command = "dot -Tpng -o #{output_filename} < #{content}" system(command) $? end |