$:.unshift File.dirname(__FILE__) module BuildMaster class FileProcessor def initialize(template, content_path, evaluator) @template = template @content_path = content_path @evaluator = evaluator end def process_textile() textile_content = IO.read(@content_path) match_result = TEXTILE_REGX.match(textile_content) title = '' if match_result != nil title = match_result[2] textile_content = match_result.post_match end html_body = RedCloth.new(textile_content).to_html html_content = < #{title} #{html_body} HTML return process_html_content(html_content) end def process_html() return process_html_content(File.open(@content_path)) end def process_html_content(source) document_with_skin = @template.process(source) {|message| @evaluator.evaluate(message, @content_path)} return document_with_skin end end end