lib/Charu/CreateHtml.rb in Charu-0.0.8 vs lib/Charu/CreateHtml.rb in Charu-0.0.9

- old
+ new

@@ -1,9 +1,7 @@ # -*- encoding: utf-8 -*- -#require 'redcarpet' - require "erb" module Charu class PageCounter def initialize() @@ -36,26 +34,13 @@ class CreateHtml attr_accessor :keyword, :css_theme_path, :link, :hiduke, :day, :title, :config def initialize(page) @config = Charu::Config.new() - #markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML) - source= ' - - # 見出し1 - ## 見出し2 - - * リスト1 - * リスト2 - - このサイトは[mukaer.com](http://mukaer.com)です。 - - ' @page = page - #puts markdown.render(source) @header = File.open("./CharuConfig/template/header.erb").read @footer = File.open("./CharuConfig/template/footer.erb").read @body = File.open("./CharuConfig/template/body.erb").read @day_body = File.open("./CharuConfig/template/day_body.erb").read @@ -91,12 +76,14 @@ p item.get_item_title#.encode(Encoding::SJIS) p i.get_item_category() } } =end - html = erb.result(binding) + @html = erb.result(binding) + + begin - File.write(@config.www_html_out_path + file_name, html) + File.write(@config.www_html_out_path + file_name, @html) rescue p "書き込みエラー" end } end \ No newline at end of file