o:$YARD::CodeObjects::MethodObject:@current_file_has_commentsT: @linei:@signature"4def process mail_template, file_paths, hostname: @scope: class: @source"Qdef process mail_template, file_paths, hostname raise "Host should not include http://" if hostname =~ /^http:\/\//i # check if there is a html file html_file_path = check! file_paths # persist files into databases. other_file_paths = file_paths - Array.wrap(html_file_path) stored_file_objects = other_file_paths.map do |path| f = File.open(path) mail_template.mail_template_files.create :file => f, :size => File.size(f) end ### replace images and csses from the html document. # possible will use this in the future to take care of encoding problem: # doc = Nokogiri.XML('', nil, 'EUC-JP') doc = Nokogiri::HTML(File.read(html_file_path)) doc.css('img, link').each do |element| # FIXME seems will have the problem if have duplicated filename in different dir case when element.name == "link" && substitution_object = stored_file_objects.detect { |file_object| file_object.attributes["file"] == File.basename(element['href']) } element['href'] = "http://#{File.join(hostname, substitution_object.file.url)}" when element.name == "img" && substitution_object = stored_file_objects.detect { |file_object| file_object.attributes["file"] == File.basename(element['src']) } element['src'] = "http://#{File.join(hostname, substitution_object.file.url)}" end end doc.to_html end: @tags[:@docstringIC:YARD::Docstring"NMailEngine::HtmlDocumentAssetsReplacer.process(mail_template, file_paths) :@ref_tags[; [: @objectu:YARD::StubProxy3MailEngine::HtmlDocumentAssetsReplacer.process: @summary0: @all["NMailEngine::HtmlDocumentAssetsReplacer.process(mail_template, file_paths):@line_rangeo: Range:endi: begini: exclF:@namespaceu;+MailEngine::HtmlDocumentAssetsReplacer: @files[["5lib/mail_engine/html_document_assets_replacer.rbi: @name: process: @dynamicT: @path"3MailEngine::HtmlDocumentAssetsReplacer.process:@parameters[["mail_template0["file_paths0[" hostname0:@docstring_extra0:@visibility: public:@source_type: ruby:@explicitT