Sha256: 0893c89cc7606a4c7b9610ad77af29dd4f104d464917f4d8c3af74d3dd8e0b98
Contents?: true
Size: 1.76 KB
Versions: 1
Compression:
Stored size: 1.76 KB
Contents
o:$YARD::CodeObjects::MethodObject:@current_file_has_commentsT: @linei4:@signature"Vdef replace_resource_in_html html, original_filename, new_filename, resource_type:@scope: class:@source"‡def replace_resource_in_html html, original_filename, new_filename, resource_type # FIXME better to raise an error, return an unprocessed file maybe not good. return html if original_filename.blank? or new_filename.blank? doc = Nokogiri::HTML(html) doc.css('img, link').each do |element| # FIXME seems will have the problem if have duplicated filename in different dir next if element.name == "link" && element['href'].blank? next if element.name == "img" && element['src'].blank? case when element.name == "link" && get_resource_url(element['href'], resource_type) == original_filename element['href'] = element['href'].sub(original_filename, new_filename) when element.name == "img" && get_resource_url(element['src'], resource_type) == original_filename element['src'] = element['src'].sub(original_filename, new_filename) end end doc.to_html end: @tags[ :@docstringIC:YARD::Docstring"5replace the old filename in html by new filename:@ref_tags[ ;[ :@objectu:YARD::StubProxyDMailEngine::HtmlDocumentAssetsReplacer.replace_resource_in_html: @summary0: @all["5replace the old filename in html by new filename:@line_rangeo: Range:endi3: begini3: exclF:@namespaceu;+MailEngine::HtmlDocumentAssetsReplacer:@files[["5lib/mail_engine/html_document_assets_replacer.rbi4: @name:replace_resource_in_html: @dynamicT: @path"DMailEngine::HtmlDocumentAssetsReplacer.replace_resource_in_html:@parameters[ [" html0["original_filename0["new_filename0["resource_type0:@docstring_extra0:@visibility:public:@source_type: ruby:@explicitT
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mail_engine-0.1.0 | .yardoc/objects/MailEngine/HtmlDocumentAssetsReplacer/replace_resource_in_html_c.dat |