Sha256: 3293afc4146f92b07267e91e2e972406acb476dd29e79933dc78d35cff27f7fc
Contents?: true
Size: 572 Bytes
Versions: 25
Compression:
Stored size: 572 Bytes
Contents
require 'mumukit/directives' class Mumukit::Directives::Sections < Mumukit::Directives::Directive def build(section, content) "#{comment_type.comment "<#{section}#"}#{content}#{comment_type.comment "##{section}>"}" end def join(sections) file_declarations, file_references = sections.map do |section, content| [build(section, content), interpolate(section)] end.transpose "#{file_declarations.join "\n"}\n#{build 'content', file_references.join("\n")}" end def interpolate(section) comment_type.comment("...#{section}...") end end
Version data entries
25 entries across 25 versions & 1 rubygems