Class: Gly::PreviewBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/gly/preview_builder.rb

Overview

builds the pdf preview from assets prepared by PreviewGenerator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePreviewBuilder

Returns a new instance of PreviewBuilder.



5
6
7
8
# File 'lib/gly/preview_builder.rb', line 5

def initialize
  @gabcs = []
  @main_tex = nil
end

Instance Attribute Details

#main_texObject

Returns the value of attribute main_tex.



14
15
16
# File 'lib/gly/preview_builder.rb', line 14

def main_tex
  @main_tex
end

Instance Method Details

#add_gabc(path) ⇒ Object



10
11
12
# File 'lib/gly/preview_builder.rb', line 10

def add_gabc(path)
  @gabcs << path
end

#buildObject



16
17
18
19
20
21
22
23
# File 'lib/gly/preview_builder.rb', line 16

def build
  @gabcs.each do |g|
    outfile = g.sub /(\.gabc)?$/i, '.gtex'
    benevolent_exec('gregorio', '-o', outfile, g)
  end

  exec 'lualatex', '--interaction=nonstopmode', @main_tex
end