Sha256: b009e40861665b96f7a095451d9eea1ac6058ef59334e160d2bb8d6923c4e9e6

Contents?: true

Size: 348 Bytes

Versions: 1

Compression:

Stored size: 348 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, 'w:utf-8')
    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

1 entries across 1 versions & 1 rubygems

Version Path
mdoc-0.0.5 lib/mdoc/writer.rb