lib/Charu/CreateHtml.rb in Charu-0.0.11 vs lib/Charu/CreateHtml.rb in Charu-0.0.12

- old
+ new

@@ -38,17 +38,19 @@ @config = Charu::Config.new() @page_max = page_max @page = page - @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 + @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 + @autoupload_lftp = File.open("./CharuConfig/autoupload.lftp").read self.keyword() self.create_body() + self.lftp() end def keyword() @keyword = "" @config.home_category.each{|key| @@ -119,8 +121,19 @@ def file_save() # ファイル書き込み @days.get_days.each{|day_name, title, html| File.write(@config.www_html_out_path + @file_name, html) } + end + + def lftp() + erb = ERB.new(@autoupload_lftp) + lftp = erb.result(binding) + + begin + File.write("./CharuConfig/autoupload.lftp", lftp) + rescue + p "書き込みエラー" + end end end end