Sha256: aba19a282c8c388ce7dc48bea9d62a1880a5b9afbf405b9af5a6620963a47c52

Contents?: true

Size: 344 Bytes

Versions: 3

Compression:

Stored size: 344 Bytes

Contents

require 'tilt/erb'

module Mdoc
  class Writer
    attr_accessor :tilt

    def out(doc)
      Mdoc.opts.no_output ? $stdout : File.new(doc.out_file, 'wb')
    end

    def process!(doc)
      @tilt = Tilt::ERBTemplate.new(doc.tpl_file)
      oh = out(doc)
      oh.write @tilt.render(doc)
      oh.close unless oh == $stdout
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mdoc-0.0.8 lib/mdoc/writer.rb
mdoc-0.0.7 lib/mdoc/writer.rb
mdoc-0.0.6 lib/mdoc/writer.rb