Sha256: 6c7d0599b3023a0939f7604ff2263dbb6d38b6c5444db21d8e2f6d90f8c90a82
Contents?: true
Size: 938 Bytes
Versions: 34
Compression:
Stored size: 938 Bytes
Contents
require "isodoc" require "mn2sts" module IsoDoc module Iso # A {Converter} implementation that generates HTML output, and a document # schema encapsulation of the document for validation # class StsConvert < IsoDoc::XslfoPdfConvert def initialize(options) @libdir = File.dirname(__FILE__) @format = :sts @suffix = "sts.xml" end def convert(input_filename, file = nil, debug = false, output_filename = nil) file = File.read(input_filename, encoding: "utf-8") if file.nil? docxml, filename, dir = convert_init(file, input_filename, debug) /\.xml$/.match(input_filename) or input_filename = Tempfile.open([filename, ".xml"], encoding: "utf-8") do |f| f.write file f.path end FileUtils.rm_rf dir Mn2sts.convert(input_filename, output_filename || "#{filename}.#{@suffix}") end end end end
Version data entries
34 entries across 31 versions & 2 rubygems