mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
improve yield_content
This commit is contained in:
parent
7d6c546a49
commit
6dc16dc457
1 changed files with 8 additions and 1 deletions
|
@ -43,7 +43,14 @@ macro yield_content(key)
|
||||||
if CONTENT_FOR_BLOCKS.has_key?({{key}})
|
if CONTENT_FOR_BLOCKS.has_key?({{key}})
|
||||||
__caller_filename__ = CONTENT_FOR_BLOCKS[{{key}}][0]
|
__caller_filename__ = CONTENT_FOR_BLOCKS[{{key}}][0]
|
||||||
%proc = CONTENT_FOR_BLOCKS[{{key}}][1]
|
%proc = CONTENT_FOR_BLOCKS[{{key}}][1]
|
||||||
%proc.call if __content_filename__ == __caller_filename__
|
|
||||||
|
if __content_filename__ == __caller_filename__
|
||||||
|
%old_content_io, content_io = content_io, IO::Memory.new
|
||||||
|
%proc.call
|
||||||
|
%result = content_io.to_s
|
||||||
|
content_io = %old_content_io
|
||||||
|
%result
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue