class ReVIEW::Converter

Attributes

target[RW]

Public Class Methods

new(book, builder) click to toggle source
# File ../../../../../lib/review/converter.rb, line 11
def initialize(book, builder)
  @book = book
  @book.config["builder"] = builder.target_name
  @compiler = ReVIEW::Compiler.new(builder)
end

Public Instance Methods

convert(file, output_path) click to toggle source
# File ../../../../../lib/review/converter.rb, line 17
def convert(file, output_path)
  chap_name = File.basename(file, '.*')
  chap = @book.chapter(chap_name)
  result = @compiler.compile(chap)
  File.open(output_path, 'w') do |f|
    f.puts result
  end
end