Sha256: 7dfb73b1cd2129c8d7044b679ac4bd3ec126c887ab396eddf8cda0c9dd31d604
Contents?: true
Size: 510 Bytes
Versions: 6
Compression:
Stored size: 510 Bytes
Contents
module Awestruct module Extensions class Gsub def initialize(pattern, replacement, options = {}) @pattern = pattern @replacement = replacement @gsub_required = options[:gsub_required] || lambda { |site, page| page.output_path.end_with?(".html") } end def transform(site, page, rendered) if (@gsub_required.call(site, page)) rendered = rendered.gsub(@pattern, @replacement) end rendered end end end end
Version data entries
6 entries across 6 versions & 1 rubygems