Class: Pressman::Builders::HtmlBuilder

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

Instance Attribute Summary

Attributes inherited from Builder

#filename

Instance Method Summary collapse

Methods inherited from Builder

start

Constructor Details

#initializeHtmlBuilder

Returns a new instance of HtmlBuilder.



5
6
7
8
9
10
11
12
13
14
# File 'lib/pressman/builders/html_builder.rb', line 5

def initialize
  Dir.mkdir(extension) unless File.exists?(extension)

  copy_assets

  Dir.glob("book/*.textile") do |file|
    @filename = File.basename(file, ".textile")
    File.open("#{extension}/#{@filename}.html", 'w') {|f| f.write(render("templates/layout.html.erb")) }
  end
end