Class: Pressman::Builders::PdfBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/pressman/builders/pdf_builder.rb

Instance Attribute Summary collapse

Attributes inherited from Builder

#filename

Instance Method Summary collapse

Methods inherited from Builder

start

Constructor Details

#initializePdfBuilder

Returns a new instance of PdfBuilder.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/pressman/builders/pdf_builder.rb', line 7

def initialize
  File.delete("#{@@config['title']}.pdf") if File.exist?("#{@@config['title']}.pdf")


  @pdf_content = ""
  Dir.glob("*/*.textile") do |file|
    @filename = File.basename(file, ".textile")

    content

    @pdf_content += render("templates/default.#{extension}.erb")
  end

  pdf = PDFKit.new(render("templates/layout.#{extension}.erb"))
  pdf.to_file("#{@@config['title']}.pdf")
end

Instance Attribute Details

#pdf_contentObject

Returns the value of attribute pdf_content.



5
6
7
# File 'lib/pressman/builders/pdf_builder.rb', line 5

def pdf_content
  @pdf_content
end