Sha256: c37f46f1cfacd16337407e13bc55a0de29fb29aacf1852ae715cbab3b2370ec5

Contents?: true

Size: 515 Bytes

Versions: 1

Compression:

Stored size: 515 Bytes

Contents

module BootPolish
  class DefaultRenderer

    def initialize(output = nil)
      @output = output || STDOUT
      @indent = -1
    end

    def descend
      @indent += 1
    end

    def exception(method, exception)
      @output << "#{indent}#{method} raised #{exception.message}\n"
    end

    def benchmark method, time
      @output << format("#{indent}%.4f for #{method}\n", time.real)
    end

    def ascend
      @indent -= 1
    end

    private

    def indent
      "  " * @indent
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
boot_polish-0.0.1 lib/boot_polish/default_renderer.rb