Sha256: c4bce72d77f99876a27aa7f96e36538478d011f3a18a48ac67b8fca5e6dc5427

Contents?: true

Size: 714 Bytes

Versions: 3

Compression:

Stored size: 714 Bytes

Contents

module Nanoc
  class ItemView
    # allows apply_attributes to create new item attributes
    def []=(key, value)
      unwrap.attributes[key] = value
    end
  end
end

module Nanoc::HashExtensions
  alias_method :original_freeze, :__nanoc_freeze_recursively

  # prevents the item's frozen attributes from remaining frozen
  def __nanoc_freeze_recursively
    return if caller.first =~ %r{base/entities/document.rb}
    original_freeze
  end
end

class ConrefFSFilter < Nanoc::Filter
  identifier :'conref-fs-filter'

  def run(content, _)
    ConrefFS.apply_attributes(@config, item, @rep.name)
    NanocConrefFS::Conrefifier.liquify(@config, path: @item[:filename], content: content, rep: @rep.name)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nanoc-conref-fs-0.6.2 lib/nanoc-conref-fs/conref-filter.rb
nanoc-conref-fs-0.6.1 lib/nanoc-conref-fs/conref-filter.rb
nanoc-conref-fs-0.6.0 lib/nanoc-conref-fs/conref-filter.rb