Update AnonymousFilter
This commit is contained in:
parent
a6973b439d
commit
b829068bd5
1 changed files with 5 additions and 6 deletions
|
@ -9,9 +9,8 @@ module Nanoc::Extension
|
||||||
require "securerandom"
|
require "securerandom"
|
||||||
##
|
##
|
||||||
# @example
|
# @example
|
||||||
# compile "/sitemap.xml.erb" do
|
# compile "/sitemap.xml" do
|
||||||
# filter(:erb)
|
# filter proc { _1.chomp }
|
||||||
# filter Proc.new { _1.each_line.reject { |s| s.strip.empty? }.join }
|
|
||||||
# write("/sitemap.xml")
|
# write("/sitemap.xml")
|
||||||
# end
|
# end
|
||||||
# @param [Proc, Symbol] fn
|
# @param [Proc, Symbol] fn
|
||||||
|
@ -21,9 +20,9 @@ module Nanoc::Extension
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def filter(fn, options = {})
|
def filter(fn, options = {})
|
||||||
if Proc === fn
|
if Proc === fn
|
||||||
id = anonymous_id
|
anonid = anonymous_id
|
||||||
Nanoc::Filter.define(id) { fn.call(_1, _2) }
|
Nanoc::Filter.define(anonid) { fn.call(_1, _2) }
|
||||||
super(id, options)
|
super(anonid, options)
|
||||||
else
|
else
|
||||||
super(fn, options)
|
super(fn, options)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue