diff options
Diffstat (limited to 'lib/extensions/revision_history_processor.rb')
| -rw-r--r-- | lib/extensions/revision_history_processor.rb | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/extensions/revision_history_processor.rb b/lib/extensions/revision_history_processor.rb deleted file mode 100644 index f416de0..0000000 --- a/lib/extensions/revision_history_processor.rb +++ /dev/null @@ -1,27 +0,0 @@ -module Nuldoc - module Extensions - class RevisionHistoryProcessor < Asciidoctor::Extensions::TreeProcessor - def process(doc) - revisions = [] - i = 1 - loop do - break unless (rev = doc.attributes["revision-#{i}"]) - revisions << parse_revision(rev) - i += 1 - end - doc.attributes['revision-history'] = revisions - end - - private - - def parse_revision(rev) - m = rev.match(/\A(\d\d\d\d-\d\d-\d\d) (.*)\z/) - raise unless m - Revision.new( - date: Date.parse(m[1], '%Y-%m-%d'), - remark: m[2], - ) - end - end - end -end |
