Sha256: b64c0ad742faa3e54d14c5eb23c104367af1f7cd3076f1229ba62417bd35f8be

Contents?: true

Size: 441 Bytes

Versions: 2

Compression:

Stored size: 441 Bytes

Contents

module Asciidoctor
  @show_debug = nil

  def self.debug
    puts yield if self.show_debug_output?
  end

  def self.set_debug(value)
    @show_debug = value
  end

  def self.show_debug_output?
    @show_debug || (ENV['DEBUG'] == 'true' && ENV['SUPPRESS_DEBUG'] != 'true')
  end

  def self.puts_indented(level, *args)
    indentation = " " * level * 2

    args.each do |arg|
      self.debug { "#{indentation}#{arg}" }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
asciidoctor-0.1.0 lib/asciidoctor/debug.rb
asciidoctor-0.0.9 lib/asciidoctor/debug.rb