diff options
| author | Ryan Waldron <rwaldron@github.com> | 2013-01-16 10:54:20 -0600 |
|---|---|---|
| committer | Ryan Waldron <rwaldron@github.com> | 2013-01-16 10:54:20 -0600 |
| commit | 0bc12f151cab4a8b2fbfa1a537b75d6ae03e004c (patch) | |
| tree | 63a54a6aa04384200f3b74b640397022f0b8a50a | |
| parent | 497fae3dfddc017e6fae9f67ba5fabed6a1c44a5 (diff) | |
Shove 'splain' output into debug block format
| -rw-r--r-- | lib/asciidoctor/document.rb | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/lib/asciidoctor/document.rb b/lib/asciidoctor/document.rb index 91f6049d..5292c5f5 100644 --- a/lib/asciidoctor/document.rb +++ b/lib/asciidoctor/document.rb @@ -255,20 +255,23 @@ class Asciidoctor::Document < Asciidoctor::AbstractBlock end def splain - if @header - Asciidoctor.debug "Header is #{@header}" - else - Asciidoctor.debug "No header" - end + Asciidoctor.debug { + msg = '' + if @header + msg = "Header is #{@header}" + else + msg = "No header" + end - Asciidoctor.debug "I have #{@blocks.count} blocks" - @blocks.each_with_index do |block, i| - Asciidoctor.debug "v" * 60 - Asciidoctor.debug "Block ##{i} is a #{block.class}" - Asciidoctor.debug "Name is #{block.title rescue 'n/a'}" - block.splain(0) if block.respond_to? :splain - Asciidoctor.debug "^" * 60 - end + msg += "I have #{@blocks.count} blocks" + @blocks.each_with_index do |block, i| + msg += "v" * 60 + msg += "Block ##{i} is a #{block.class}" + msg += "Name is #{block.title rescue 'n/a'}" + block.splain(0) if block.respond_to? :splain + msg += "^" * 60 + end + } nil end |
